code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import numpy as np
import gym
import sys
import rospy
from quads_msgs.msg import Transition
from std_msgs.msg import Empty
class BaxterHwEnv(gym.Env):
def __init__(self):
# Calling init method of parent class.
super(BaxterHwEnv, self).__init__()
# Setting name of ros node.
self._n... | [
"rospy.Subscriber",
"rospy.Publisher",
"rospy.sleep",
"std_msgs.msg.Empty",
"rospy.get_param",
"rospy.is_shutdown",
"numpy.sin",
"numpy.array",
"gym.spaces.Box",
"numpy.cos",
"rospy.logwarn_throttle",
"rospy.get_name",
"rospy.has_param",
"sys.exit"
] | [((661, 720), 'gym.spaces.Box', 'gym.spaces.Box', (['(-np.inf)', 'np.inf', '(NUM_PREPROCESSED_STATES,)'], {}), '(-np.inf, np.inf, (NUM_PREPROCESSED_STATES,))\n', (675, 720), False, 'import gym\n'), ((749, 800), 'gym.spaces.Box', 'gym.spaces.Box', (['(-np.inf)', 'np.inf', '(NUM_ACTION_DIMS,)'], {}), '(-np.inf, np.inf, (... |
"""
This Module being called from .sh script for the problem 2
Runs the pre-trained ACGAN model and saves generates 10 pairs of images entangled via 'smiling feature attribute'
"""
# general
import random
import os
import numpy as np
# dl related
import torch
from torch.autograd import Variable
# custom modules
imp... | [
"torch.manual_seed",
"torch.load",
"acgan.Generator_ACGAN",
"numpy.zeros",
"torch.cat",
"numpy.ones",
"torch.randn",
"numpy.hstack",
"random.seed",
"torch.cuda.is_available",
"parser.arg_parse",
"os.path.join",
"torch.from_numpy"
] | [((572, 590), 'numpy.ones', 'np.ones', (['num_pairs'], {}), '(num_pairs)\n', (579, 590), True, 'import numpy as np\n'), ((644, 663), 'numpy.zeros', 'np.zeros', (['num_pairs'], {}), '(num_pairs)\n', (652, 663), True, 'import numpy as np\n'), ((717, 741), 'numpy.hstack', 'np.hstack', (['(ones, zeros)'], {}), '((ones, zer... |
#!/usr/bin/env python2
from sys import argv, exit
from os import listdir
from math import sqrt
from cv2 import imread
from scipy.misc import imresize
from keras.models import load_model
from numpy import float32, transpose, expand_dims
from PyQt5.QtWidgets import QLabel, QWidget, QApplication, QPushButton
from PyQt5.Q... | [
"keras.models.load_model",
"PyQt5.QtGui.QColor",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtWidgets.QApplication",
"PyQt5.QtGui.QPainter",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtGui.QPixmap.fromImage",
"numpy.transpose",
"PyQt5.QtCore.QTimer",
"math.sqrt",
"PyQt5.QtGui.QPalette",
"PyQt5.QtGui.QImage"... | [((14543, 14559), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['[]'], {}), '([])\n', (14555, 14559), False, 'from PyQt5.QtWidgets import QLabel, QWidget, QApplication, QPushButton\n'), ((1868, 1896), 'PyQt5.QtGui.QFont', 'QFont', (['"""Source Sans Pro"""', '(24)'], {}), "('Source Sans Pro', 24)\n", (1873, 1896), F... |
import os, sys, glob
import argparse
import numpy as np
import pandas as pd
from scipy.interpolate import griddata
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import pyplot as plt, rc
from matplotlib.pyplot import figure
import figure_size
plt.style.use("../../publication.mplstyle")
def ... | [
"numpy.save",
"numpy.abs",
"pandas.read_hdf",
"argparse.ArgumentParser",
"matplotlib.pyplot.style.use",
"numpy.min",
"numpy.mean"
] | [((270, 313), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""../../publication.mplstyle"""'], {}), "('../../publication.mplstyle')\n", (283, 313), True, 'from matplotlib import pyplot as plt, rc\n'), ((354, 418), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""The sky is not the li... |
__author__ = '<NAME> (<EMAIL>)'
import numpy as np
def update_user_count_eponymous(set_of_contributors, anonymous_coward_comments_counter):
"""
Eponymous user count update.
Input: - set_of_contributors: A python set of user ids.
- anonymous_coward_comments_counter: The number of comments po... | [
"numpy.abs",
"numpy.sum",
"numpy.log",
"numpy.zeros",
"numpy.argsort"
] | [((1998, 2036), 'numpy.argsort', 'np.argsort', (['contributor_comment_counts'], {}), '(contributor_comment_counts)\n', (2008, 2036), True, 'import numpy as np\n'), ((3383, 3416), 'numpy.sum', 'np.sum', (['contributor_comment_count'], {}), '(contributor_comment_count)\n', (3389, 3416), True, 'import numpy as np\n'), ((4... |
# Copyright 2016-2019 <NAME>. All rights reserved.
# Use of this source code is governed by a MIT
# license that can be found in the LICENSE file.
"""
`Mutual information`_ (MI) is a measure of the amount of mutual dependence
between two random variables. When applied to time series, two time series are
used to constru... | [
"pyinform.error.error_guard",
"ctypes.byref",
"numpy.empty",
"ctypes.c_ulong",
"pyinform.error.ErrorCode",
"numpy.amax",
"numpy.ascontiguousarray",
"ctypes.POINTER"
] | [((2160, 2200), 'numpy.ascontiguousarray', 'np.ascontiguousarray', (['xs'], {'dtype': 'np.int32'}), '(xs, dtype=np.int32)\n', (2180, 2200), True, 'import numpy as np\n'), ((2210, 2250), 'numpy.ascontiguousarray', 'np.ascontiguousarray', (['ys'], {'dtype': 'np.int32'}), '(ys, dtype=np.int32)\n', (2230, 2250), True, 'imp... |
#!/usr/bin/env python
"""
Several forms of the logistic function and their first and second derivatives
The current functions are the following. Each function has a second form with
`_p` appended to the name, where parameters are given as an iterable, e.g.
`logistic` and `logistic_p` = `logistic(x, *p)`:
.. list-tabl... | [
"scipy.special.expit",
"numpy.cosh",
"numpy.sinh",
"doctest.testmod"
] | [((13054, 13111), 'doctest.testmod', 'doctest.testmod', ([], {'optionflags': 'doctest.NORMALIZE_WHITESPACE'}), '(optionflags=doctest.NORMALIZE_WHITESPACE)\n', (13069, 13111), False, 'import doctest\n'), ((3626, 3648), 'scipy.special.expit', 'sp.expit', (['(k * (x - x0))'], {}), '(k * (x - x0))\n', (3634, 3648), True, '... |
import numpy as np
from .abstract_seair import AbstractSEAIR
from .ode_model import ODEModel
from ..packages import click
class SEAIR(ODEModel, AbstractSEAIR):
"""
A simple SIR model linearized around the DFE.
"""
def diff(self, x, t):
s, e, a, i, r = x
n = s + e + a + i + r
... | [
"numpy.array"
] | [((503, 638), 'numpy.array', 'np.array', (['[-infections, +infections - sigma * e, +(1 - Qs) * sigma * e - gamma * a, +\n Qs * sigma * e - gamma * i, +gamma * (i + a)]'], {}), '([-infections, +infections - sigma * e, +(1 - Qs) * sigma * e - \n gamma * a, +Qs * sigma * e - gamma * i, +gamma * (i + a)])\n', (511, 6... |
import matplotlib.pyplot as plt
import pandas as pd
from sklearn import neighbors
from sklearn.model_selection import train_test_split
import sklearn.neighbors
from mlxtend.plotting import plot_decision_regions
import numpy as np
from sklearn.metrics import confusion_matrix, classification_report
def split_input_data(... | [
"matplotlib.pyplot.title",
"pandas.DataFrame",
"sklearn.metrics.confusion_matrix",
"sklearn.neighbors.KNeighborsRegressor",
"matplotlib.pyplot.show",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"numpy.asarray",
"sklearn.metrics.classification_report",
"matplotlib.pyplot.ylabel",... | [((577, 599), 'sklearn.model_selection.train_test_split', 'train_test_split', (['x', 'y'], {}), '(x, y)\n', (593, 599), False, 'from sklearn.model_selection import train_test_split\n'), ((793, 808), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""X"""'], {}), "('X')\n", (803, 808), True, 'import matplotlib.pyplot as pl... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 8 17:15:32 2021
@author: rolly
"""
from tensorflow.keras.models import Sequential,load_model
from tensorflow.keras.layers import Dense
from tensorflow.keras.losses import MeanSquaredError
import numpy as np
import matplotlib.pyplot as plt
from tensorflow import device
fr... | [
"matplotlib.pyplot.title",
"numpy.sum",
"tensorflow.keras.layers.Dense",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.figure",
"numpy.mean",
"pathlib.Path",
"tensorflow.keras.models.Sequential",
"matplotlib.pyplot.imshow",
"numpy.savetxt",
"os.path.exists",
"numpy.reshape",
"matplotlib.p... | [((600, 622), 'numpy.delete', 'np.delete', (['label', '(0)', '(1)'], {}), '(label, 0, 1)\n', (609, 622), True, 'import numpy as np\n'), ((774, 796), 'numpy.delete', 'np.delete', (['label', '(0)', '(1)'], {}), '(label, 0, 1)\n', (783, 796), True, 'import numpy as np\n'), ((1942, 1964), 'numpy.zeros', 'np.zeros', ([], {'... |
import argparse
import logging
import nengo
from nengo import spa
import nengo_spinnaker
import numpy as np
from six import iteritems
import time
def label_net(network, prefixes=tuple()):
for net in network.networks:
label_net(net, prefixes + (net.label, ))
prefix = ".".join(p or "?" for p in prefix... | [
"nengo_spinnaker.Simulator",
"argparse.ArgumentParser",
"logging.basicConfig",
"nengo.spa.State",
"nengo_spinnaker.add_spinnaker_params",
"numpy.square",
"nengo.Probe",
"time.time",
"numpy.savez_compressed",
"nengo.spa.Input",
"numpy.array",
"nengo.spa.Actions",
"nengo.Simulator",
"six.ite... | [((4434, 4449), 'six.iteritems', 'iteritems', (['data'], {}), '(data)\n', (4443, 4449), False, 'from six import iteritems\n'), ((4790, 4833), 'numpy.savez_compressed', 'np.savez_compressed', (['filename'], {}), '(filename, **final_data)\n', (4809, 4833), True, 'import numpy as np\n'), ((4922, 4947), 'argparse.ArgumentP... |
import csv
import numpy as np
import math
import logging
class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
def update(sel... | [
"numpy.full",
"numpy.trapz",
"numpy.minimum",
"numpy.sum",
"logging.FileHandler",
"csv.writer",
"numpy.std",
"logging.StreamHandler",
"logging.Formatter",
"numpy.min",
"numpy.mean",
"numpy.where",
"numpy.max",
"numpy.array",
"logging.getLogger"
] | [((2250, 2266), 'numpy.trapz', 'np.trapz', (['tp', 'fp'], {}), '(tp, fp)\n', (2258, 2266), True, 'import numpy as np\n'), ((2925, 2968), 'numpy.full', 'np.full', (['(Nfixations_oth, n_splits)', 'np.nan'], {}), '((Nfixations_oth, n_splits), np.nan)\n', (2932, 2968), True, 'import numpy as np\n'), ((3304, 3329), 'numpy.f... |
#!/usr/bin/env python
#===============================================================================
# Copyright 2017 Geoscience Australia
#
# 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 ... | [
"scipy.spatial.ckdtree.cKDTree",
"numpy.sum",
"numpy.ones",
"numpy.isnan",
"numpy.argsort",
"numpy.shape",
"scipy.interpolate.interp1d",
"shapely.geometry.Point",
"math.pow",
"numpy.isfinite",
"numpy.cumsum",
"numpy.max",
"numpy.log10",
"scipy.interpolate.griddata",
"numpy.float",
"num... | [((2054, 2101), 'numpy.zeros', 'np.zeros', ([], {'shape': 'thickness.shape', 'dtype': 'np.float'}), '(shape=thickness.shape, dtype=np.float)\n', (2062, 2101), True, 'import numpy as np\n'), ((2187, 2212), 'numpy.cumsum', 'np.cumsum', (['thickness[:-1]'], {}), '(thickness[:-1])\n', (2196, 2212), True, 'import numpy as n... |
import numpy as np
import torch
import torch.nn as nn
import math
import torch.nn.functional as F
class NASMODE:
microsearch = 0
channelsearch = 1
vanilla = 2
class Arch_State:
def __init__(self, device, input_file = None) -> None:
self.device = device
self.layer_alphas = {}
... | [
"numpy.ceil",
"matplotlib.pyplot.plot",
"numpy.power",
"numpy.floor",
"torch.argmax",
"torch.randn",
"numpy.random.randint",
"numpy.arange",
"torch.Tensor",
"numpy.linspace",
"torch.tensor",
"torch.sum",
"matplotlib.pyplot.savefig"
] | [((7695, 7714), 'numpy.arange', 'np.arange', (['no_steps'], {}), '(no_steps)\n', (7704, 7714), True, 'import numpy as np\n'), ((7815, 7833), 'matplotlib.pyplot.plot', 'plt.plot', (['norm_pdf'], {}), '(norm_pdf)\n', (7823, 7833), True, 'import matplotlib.pyplot as plt\n'), ((7838, 7879), 'matplotlib.pyplot.savefig', 'pl... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : LongVideoNvN.py
# Author : <NAME>
# Email : <EMAIL>
# Date : 08/02/2021
#
# This file is part of TOQ-Nets-PyTorch.
# Distributed under terms of the MIT license.
import os
import random
from copy import deepcopy
import numpy as np
import torch
from toqnets... | [
"numpy.random.seed",
"numpy.maximum",
"torch.cat",
"numpy.random.default_rng",
"numpy.arange",
"os.path.join",
"toqnets.config_update.update_config",
"random.randint",
"torch.Tensor",
"torch.zeros",
"numpy.random.shuffle",
"numpy.repeat",
"copy.deepcopy",
"toqnets.config_update.ConfigUpdat... | [((532, 558), 'os.path.join', 'os.path.join', (['"""data"""', 'name'], {}), "('data', name)\n", (544, 558), False, 'import os\n'), ((645, 663), 'os.listdir', 'os.listdir', (['folder'], {}), '(folder)\n', (655, 663), False, 'import os\n'), ((879, 911), 'numpy.concatenate', 'np.concatenate', (['np_datas'], {'axis': '(0)'... |
# -*- coding: utf-8 -*-
"""Tests for Coastal Blue Carbon Functions."""
import logging
import os
import pprint
import shutil
import tempfile
import unittest
import glob
import numpy
from osgeo import gdal, osr
import pygeoprocessing
from natcap.invest import utils
from natcap.invest.coastal_blue_carbon import coastal_... | [
"pprint.pformat",
"os.walk",
"natcap.invest.coastal_blue_carbon.coastal_blue_carbon._track_disturbance",
"logging.getLogger",
"shutil.rmtree",
"os.path.join",
"natcap.invest.coastal_blue_carbon.coastal_blue_carbon._calculate_emissions",
"os.path.dirname",
"pygeoprocessing.numpy_array_to_raster",
"... | [((467, 494), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (484, 494), False, 'import logging\n'), ((370, 395), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (385, 395), False, 'import os\n'), ((707, 725), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()... |
import pandas as pd
import numpy as np
from scipy.stats import hmean, gmean, entropy
from sklearn.decomposition import PCA
# Macros
METRICS = ['precision', 'recall', 'f1-score', 'auc', 'kappa']
PCA_THRESH = 0.95
class StatsMetrics():
def __init__(self):
pass
def _get_prop_pca(self, df: pd.DataFrame)... | [
"scipy.stats.gmean",
"scipy.stats.entropy",
"numpy.ones",
"sklearn.decomposition.PCA",
"pandas.melt",
"scipy.stats.hmean"
] | [((368, 396), 'sklearn.decomposition.PCA', 'PCA', ([], {'n_components': 'PCA_THRESH'}), '(n_components=PCA_THRESH)\n', (371, 396), False, 'from sklearn.decomposition import PCA\n'), ((2146, 2181), 'pandas.melt', 'pd.melt', (['metrics'], {'id_vars': "['index']"}), "(metrics, id_vars=['index'])\n", (2153, 2181), True, 'i... |
import os
import numpy as np
import torch
from functools import partial
from torchnet.transform import compose
from torchnet.dataset import ListDataset, TransformDataset
from fewshots.data.base import convert_dict, CudaTransform, EpisodicBatchSampler
from fewshots.data.setup import setup_images
from fewshots.data.cach... | [
"functools.partial",
"fewshots.data.SetupEpisode.SetupEpisode",
"torchnet.dataset.ListDataset",
"fewshots.data.cache.Cache",
"torchnet.transform.compose",
"torch.utils.data.DataLoader",
"fewshots.data.base.CudaTransform",
"torch.cat",
"numpy.random.randint",
"torch.randperm",
"fewshots.utils.fil... | [((902, 927), 'torch.cat', 'torch.cat', (['xs_list'], {'dim': '(0)'}), '(xs_list, dim=0)\n', (911, 927), False, 'import torch\n'), ((1284, 1307), 'fewshots.utils.filter_opt', 'filter_opt', (['opt', '"""augm"""'], {}), "(opt, 'augm')\n", (1294, 1307), False, 'from fewshots.utils import filter_opt\n'), ((1358, 1447), 'os... |
"""
NCL_polyg_8_lbar.py
===================
This script illustrates the following concepts:
- Drawing a scatter plot on a map
- Changing the marker color and size in a map plot
- Plotting station locations using markers
- Creating a custom color bar
- Adding text to a plot
- Generating dummy data usin... | [
"matplotlib.pyplot.show",
"geocat.viz.util.set_titles_and_labels",
"matplotlib.pyplot.axes",
"matplotlib.cm.ScalarMappable",
"matplotlib.colors.BoundaryNorm",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.colorbar",
"numpy.random.default_rng",
"matplotlib.pyplot.figure",
"geocat.viz.util.add_lat... | [((1051, 1080), 'numpy.random.default_rng', 'np.random.default_rng', ([], {'seed': '(1)'}), '(seed=1)\n', (1072, 1080), True, 'import numpy as np\n'), ((1757, 1796), 'matplotlib.colors.BoundaryNorm', 'colors.BoundaryNorm', (['boundaries', 'cmap.N'], {}), '(boundaries, cmap.N)\n', (1776, 1796), False, 'from matplotlib i... |
# coding: utf-8
""" Astropy coordinate class for the Sagittarius coordinate system """
from __future__ import division, print_function
__author__ = "adrn <<EMAIL>>"
# Third-party
import numpy as np
from astropy.coordinates import frame_transform_graph
from astropy.coordinates.angles import rotation_matrix
import a... | [
"astropy.coordinates.frame_transform_graph.transform",
"numpy.radians",
"astropy.coordinates.angles.rotation_matrix",
"astropy.coordinates.RepresentationMapping"
] | [((1819, 1837), 'numpy.radians', 'np.radians', (['(128.79)'], {}), '(128.79)\n', (1829, 1837), True, 'import numpy as np\n'), ((1846, 1863), 'numpy.radians', 'np.radians', (['(54.39)'], {}), '(54.39)\n', (1856, 1863), True, 'import numpy as np\n'), ((1870, 1886), 'numpy.radians', 'np.radians', (['(90.7)'], {}), '(90.7)... |
import numpy as np
from .base import Representation
from acousticsim.exceptions import AcousticSimError
from acousticsim.analysis.specgram import file_to_powerspec
class Spectrogram(Representation):
def __init__(self, file_path, min_freq, max_freq, win_len, time_step, data=None, attributes=None):
Represen... | [
"acousticsim.analysis.specgram.file_to_powerspec",
"numpy.arange",
"acousticsim.exceptions.AcousticSimError",
"numpy.spacing"
] | [((1418, 1481), 'acousticsim.analysis.specgram.file_to_powerspec', 'file_to_powerspec', (['self.file_path', 'self.win_len', 'self.time_step'], {}), '(self.file_path, self.win_len, self.time_step)\n', (1435, 1481), False, 'from acousticsim.analysis.specgram import file_to_powerspec\n'), ((1148, 1208), 'acousticsim.excep... |
import argparse
import os
import random
import numpy as np
import torch
from torch.nn.functional import mse_loss
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from pynif3d.common.verification import check_equal
from pynif3d.datasets import Blender
from pynif3d.loss.conversi... | [
"numpy.random.seed",
"argparse.ArgumentParser",
"torch.cuda.current_device",
"os.path.join",
"torch.utils.data.DataLoader",
"torch.load",
"os.path.exists",
"random.seed",
"torch.utils.tensorboard.SummaryWriter",
"pynif3d.common.verification.check_equal",
"pynif3d.pipeline.nerf.NeRF",
"torch.ma... | [((449, 474), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (472, 474), False, 'import argparse\n'), ((1482, 1526), 'os.path.join', 'os.path.join', (['save_directory', 'model_filename'], {}), '(save_directory, model_filename)\n', (1494, 1526), False, 'import os\n'), ((1748, 1781), 'torch.save'... |
import json
import pickle
import warnings
import os
import numpy as np
import pandas as pd
import networkx as nx
from math import ceil
from collections import defaultdict, Counter
from tqdm import tqdm
from matplotlib import pyplot as plt
import pystan
from convokit import Utterance, Corpus, User, Coordination, down... | [
"tqdm.tqdm",
"numpy.sum",
"pandas.read_csv",
"pandas.merge",
"collections.defaultdict",
"spacy.load",
"networkx.connected_components",
"networkx.Graph",
"networkx.eigenvector_centrality_numpy",
"warnings.warn"
] | [((432, 448), 'spacy.load', 'spacy.load', (['"""en"""'], {}), "('en')\n", (442, 448), False, 'import spacy\n'), ((1254, 1271), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (1265, 1271), False, 'from collections import defaultdict, Counter\n'), ((1292, 1303), 'tqdm.tqdm', 'tqdm', (['lines'], {})... |
import csv
import itertools
import operator
import numpy as np
import nltk
import os
import sys
from datetime import datetime
from keras.models import Sequential
from keras.layers import Dense, Activation,TimeDistributed
from keras.layers import LSTM,GRU
from keras.layers.embeddings import Embedding
from keras.optimize... | [
"yaml.load",
"csv.reader",
"numpy.argmax",
"keras.preprocessing.sequence.pad_sequences",
"keras.callbacks.ModelCheckpoint",
"matplotlib.pyplot.legend",
"keras.layers.GRU",
"keras.optimizers.Adam",
"matplotlib.pyplot.ylabel",
"matplotlib.use",
"keras.callbacks.EarlyStopping",
"keras.layers.Dens... | [((949, 963), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (956, 963), True, 'import matplotlib as mpl\n'), ((1164, 1177), 'csv.reader', 'csv.reader', (['f'], {}), '(f)\n', (1174, 1177), False, 'import csv\n'), ((3440, 3453), 'csv.reader', 'csv.reader', (['f'], {}), '(f)\n', (3450, 3453), False, 'impo... |
import cv2
import numpy as np
import math
import matplotlib.pyplot as plt
# colour-science を
# PiPi からインストールしておく
from colour.plotting import *
#----------UI-----------------------
#import pyto_ui as ui
#view = ui.View()
#view.background_color = ui.COLOR_SYSTEM_BACKGROUND
#ui.show_view(view, ui.PRESENTATION_MODE_SHEE... | [
"matplotlib.pyplot.show",
"cv2.cvtColor",
"cv2.imwrite",
"matplotlib.pyplot.imshow",
"numpy.zeros",
"cv2.remap",
"cv2.VideoCapture",
"matplotlib.pyplot.figure",
"cv2.imshow",
"cv2.resize"
] | [((1273, 1309), 'numpy.zeros', 'np.zeros', (['(aH, aW)'], {'dtype': 'np.float32'}), '((aH, aW), dtype=np.float32)\n', (1281, 1309), True, 'import numpy as np\n'), ((1320, 1356), 'numpy.zeros', 'np.zeros', (['(aH, aW)'], {'dtype': 'np.float32'}), '((aH, aW), dtype=np.float32)\n', (1328, 1356), True, 'import numpy as np\... |
"""This module computes distances between DNA/protein sequences based on the
sequence feature, named Base-Base Correlation (BBC).
References:
1. Liu, Zhi-Hua, et al. (2007) Bioinformatics and Biomedical Engineering,
ICBBE. The 1st International Conference on. IEEE, 2007.
doi: 10.1109/ICBBE.2007.98
... | [
"numpy.dot",
"numpy.zeros",
"numpy.sum"
] | [((2169, 2180), 'numpy.zeros', 'np.zeros', (['L'], {}), '(L)\n', (2177, 2180), True, 'import numpy as np\n'), ((2234, 2243), 'numpy.sum', 'np.sum', (['p'], {}), '(p)\n', (2240, 2243), True, 'import numpy as np\n'), ((2276, 2292), 'numpy.zeros', 'np.zeros', (['(L, L)'], {}), '((L, L))\n', (2284, 2292), True, 'import num... |
from time import time
import numpy as np
from scipy.stats import multivariate_normal as normal
from experiments.lnpdfs.create_target_lnpfs import build_GPR_iono_lnpdf
from sampler.elliptical_slice.bovy_mcmc.elliptical_slice import elliptical_slice as ess_update
num_dimensions = 34
prior_chol = np.eye(num_dimensions)
... | [
"numpy.empty",
"numpy.zeros",
"time.time",
"numpy.array",
"sampler.elliptical_slice.bovy_mcmc.elliptical_slice.elliptical_slice",
"experiments.lnpdfs.create_target_lnpfs.build_GPR_iono_lnpdf",
"numpy.eye"
] | [((297, 319), 'numpy.eye', 'np.eye', (['num_dimensions'], {}), '(num_dimensions)\n', (303, 319), True, 'import numpy as np\n'), ((389, 411), 'experiments.lnpdfs.create_target_lnpfs.build_GPR_iono_lnpdf', 'build_GPR_iono_lnpdf', ([], {}), '()\n', (409, 411), False, 'from experiments.lnpdfs.create_target_lnpfs import bui... |
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
# ------------------------------------
import os
import datetime
import re
import shutil
from munch import munchify
from collections import OrderedDict
import numpy as np
import yaml
import torch
# pylint: d... | [
"numpy.random.seed",
"os.path.join",
"munch.munchify",
"os.makedirs",
"os.path.basename",
"torch.manual_seed",
"os.walk",
"numpy.zeros",
"torch.set_default_tensor_type",
"datetime.datetime.now",
"torch.cuda.is_available",
"yaml.safe_load",
"torch.device",
"collections.OrderedDict",
"re.s... | [((1152, 1167), 'os.walk', 'os.walk', (['folder'], {}), '(folder)\n', (1159, 1167), False, 'import os\n'), ((1452, 1484), 're.sub', 're.sub', (['"""[^A-Za-z0-9]+"""', '""""""', 'now'], {}), "('[^A-Za-z0-9]+', '', now)\n", (1458, 1484), False, 'import re\n'), ((1595, 1632), 'os.path.join', 'os.path.join', (['results_dir... |
import numpy
import pytest
from numpy.testing import assert_allclose, assert_almost_equal
from fgivenx._utils import _check_args, _normalise_weights, \
_equally_weight_samples
def test__check_args():
numpy.random.seed(0)
nfuncs = 3
logZ = numpy.random.rand(nfuncs)
f = [lambd... | [
"numpy.random.seed",
"numpy.sum",
"numpy.ones_like",
"fgivenx._utils._equally_weight_samples",
"fgivenx._utils._normalise_weights",
"numpy.ones",
"pytest.raises",
"numpy.max",
"numpy.array",
"numpy.exp",
"numpy.linspace",
"numpy.random.rand",
"numpy.testing.assert_allclose",
"fgivenx._util... | [((233, 253), 'numpy.random.seed', 'numpy.random.seed', (['(0)'], {}), '(0)\n', (250, 253), False, 'import numpy\n'), ((280, 305), 'numpy.random.rand', 'numpy.random.rand', (['nfuncs'], {}), '(nfuncs)\n', (297, 305), False, 'import numpy\n'), ((375, 399), 'numpy.linspace', 'numpy.linspace', (['(0)', '(1)', 'nx'], {}), ... |
import os
import datetime
from tensorflow import keras
import pandas as pd
import numpy as np
import pickle
import json
class Logic():
def __init__(self):
with open('pickle_model.pkl', 'rb') as file:
pickle_model = pickle.load(file)
json_model = keras.models.load_model('model.... | [
"json.load",
"tensorflow.keras.models.load_model",
"numpy.argmax",
"json.dumps",
"pickle.load",
"pandas.to_datetime",
"pandas.Series",
"datetime.datetime.now"
] | [((289, 326), 'tensorflow.keras.models.load_model', 'keras.models.load_model', (['"""model.json"""'], {}), "('model.json')\n", (312, 326), False, 'from tensorflow import keras\n'), ((719, 766), 'pandas.to_datetime', 'pd.to_datetime', (['f"""{yr}/{m}/{d}T{h}:00:00+00:00"""'], {}), "(f'{yr}/{m}/{d}T{h}:00:00+00:00')\n", ... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... | [
"argparse.ArgumentParser",
"torchbeast.env_wrappers.create_env",
"numpy.zeros",
"numpy.ones",
"time.sleep",
"threading.Lock",
"libtorchbeast.rpcenv.Server",
"multiprocessing.Process"
] | [((820, 884), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Remote Environment Server"""'}), "(description='Remote Environment Server')\n", (843, 884), False, 'import argparse\n'), ((2601, 2617), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (2615, 2617), False, 'import threadin... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
from torch.nn import functional as F
from maskrcnn_benchmark.layers import smooth_l1_loss
from maskrcnn_benchmark.modeling.matcher import Matcher
from maskrcnn_benchmark.structures.boxlist_ops import boxlist_iou
from maskrcnn_benchmar... | [
"torch.ones_like",
"torch.eq",
"torch.ones",
"numpy.sum",
"torch.stack",
"torch.zeros_like",
"cv2.waitKey",
"maskrcnn_benchmark.structures.boxlist_ops.boxlist_iou",
"torch.empty",
"cv2.imshow",
"torch.nonzero",
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.max",
"maskrcnn_... | [((13973, 14094), 'maskrcnn_benchmark.modeling.matcher.Matcher', 'Matcher', (['cfg.MODEL.ROI_HEADS.FG_IOU_THRESHOLD', 'cfg.MODEL.ROI_HEADS.BG_IOU_THRESHOLD'], {'allow_low_quality_matches': '(False)'}), '(cfg.MODEL.ROI_HEADS.FG_IOU_THRESHOLD, cfg.MODEL.ROI_HEADS.\n BG_IOU_THRESHOLD, allow_low_quality_matches=False)\n... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import tensorflow as tf
import numpy as np
command2int = {"up": 0, "left": 1, "right": 2}
int2command = {i[1]: i[0] for i in command2int.items()}
def run_test(testClass):
"""
Function to run all the tests from a class of tests.
:param testCl... | [
"numpy.vectorize",
"tensorflow.contrib.data.TFRecordDataset",
"numpy.sum",
"unittest.TextTestRunner",
"tensorflow.parse_single_sequence_example",
"tensorflow.train.Example",
"tensorflow.decode_raw",
"tensorflow.cast",
"numpy.random.randint",
"numpy.array",
"unittest.TestLoader",
"tensorflow.Fi... | [((988, 1037), 'tensorflow.python_io.tf_record_iterator', 'tf.python_io.tf_record_iterator', ([], {'path': 'record_path'}), '(path=record_path)\n', (1019, 1037), True, 'import tensorflow as tf\n'), ((2263, 2293), 'numpy.array', 'np.array', (['reconstructed_images'], {}), '(reconstructed_images)\n', (2271, 2293), True, ... |
import os
import shutil
import UQpy as uq
import numpy as np
import sys
class RunCommandLine:
def __init__(self, argparseobj):
os.system('clear')
self.args = argparseobj
################################################################################################################
... | [
"itertools.repeat",
"csv.writer",
"shutil.rmtree",
"os.getcwd",
"numpy.savetxt",
"UQpy.SampleMethods.init_sm",
"os.system",
"UQpy.Reliability.run_rm",
"shutil.copy",
"os.path.isfile",
"shutil.move",
"UQpy.SampleMethods.run_sm",
"UQpy.ReadInputFile.readfile",
"UQpy.Reliability.init_rm",
"... | [((142, 160), 'os.system', 'os.system', (['"""clear"""'], {}), "('clear')\n", (151, 160), False, 'import os\n'), ((2163, 2176), 'UQpy.SampleMethods.init_sm', 'init_sm', (['data'], {}), '(data)\n', (2170, 2176), False, 'from UQpy.SampleMethods import init_sm, run_sm\n'), ((2353, 2365), 'UQpy.SampleMethods.run_sm', 'run_... |
import numpy as np
import torch
import gc
from sklearn.metrics import accuracy_score, precision_recall_fscore_support
from summarizer import Summarizer
from summarizer.coreference_handler import CoreferenceHandler
from transformers import (BartForConditionalGeneration, BartTokenizerFast,
Disti... | [
"torch.nn.Dropout",
"sklearn.metrics.accuracy_score",
"torch.cat",
"gc.collect",
"transformers.BartTokenizerFast.from_pretrained",
"sklearn.metrics.precision_recall_fscore_support",
"transformers.BartForConditionalGeneration.from_pretrained",
"summarizer.Summarizer",
"summarizer.coreference_handler.... | [((450, 516), 'transformers.BartTokenizerFast.from_pretrained', 'BartTokenizerFast.from_pretrained', (['"""sshleifer/distilbart-cnn-12-6"""'], {}), "('sshleifer/distilbart-cnn-12-6')\n", (483, 516), False, 'from transformers import BartForConditionalGeneration, BartTokenizerFast, DistilBertConfig, DistilBertModel, Dist... |
import dlib
import cv2
import numpy as np
from dlib import rectangle
import dlib
import FeatureExtraction1 as ft
from sklearn.externals import joblib
predictorPath = "faceModels/shape_predictor_68_face_landmarks.dat"
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor(predictorPath)
def extra... | [
"cv2.bitwise_and",
"FeatureExtraction1.getFeatureVector",
"cv2.rectangle",
"cv2.imshow",
"cv2.inRange",
"dlib.shape_predictor",
"numpy.max",
"cv2.destroyAllWindows",
"cv2.resize",
"cv2.circle",
"cv2.waitKey",
"numpy.min",
"cv2.convexHull",
"dlib.get_frontal_face_detector",
"sklearn.exter... | [((229, 261), 'dlib.get_frontal_face_detector', 'dlib.get_frontal_face_detector', ([], {}), '()\n', (259, 261), False, 'import dlib\n'), ((274, 309), 'dlib.shape_predictor', 'dlib.shape_predictor', (['predictorPath'], {}), '(predictorPath)\n', (294, 309), False, 'import dlib\n'), ((2925, 2983), 'cv2.polylines', 'cv2.po... |
import numpy as np
import math
from unitreepy.robots.a1.constants import HIP_OFFSETS,MOTOR_DIRECTION
from unitreepy.robots.a1.constants import LEG_LENGTH, BASE_TO_HIPS, COM_TO_HIPS, ANGLE_DIRECTION
#HIP_COEFFICIENT = 0.08505 #original motion imitation
HIP_COEFFICIENT = 0.0838
def leg_kinematics(motor_angles, link_leng... | [
"numpy.arctan2",
"math.asin",
"math.atan2",
"numpy.zeros",
"numpy.arcsin",
"math.acos",
"numpy.sin",
"numpy.array",
"math.cos",
"numpy.cos"
] | [((610, 735), 'numpy.array', 'np.array', (['[-l2 * s2 - l3 * s23 + r0_x, -l1 * c1 + (l2 * c2 + l3 * c23) * s1 + r0_y, -\n l1 * s1 - (l2 * c2 + l3 * c23) * c1]'], {}), '([-l2 * s2 - l3 * s23 + r0_x, -l1 * c1 + (l2 * c2 + l3 * c23) * s1 +\n r0_y, -l1 * s1 - (l2 * c2 + l3 * c23) * c1])\n', (618, 735), True, 'import ... |
## Copyright 2020 UT-Battelle, LLC. See LICENSE.txt for more information.
###
# @author <NAME>, <NAME>, <NAME>, <NAME>
# <EMAIL>
#
# Modification:
# Baseline code
# Date: Apr, 2020
# **************************************************************************
###
import numpy as np
import re
... | [
"numpy.load",
"numpy.save",
"deffe_utils.ReshapeCosts",
"numpy.array",
"numpy.random.permutation",
"numpy.delete",
"re.compile"
] | [((3594, 3606), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (3602, 3606), True, 'import numpy as np\n'), ((3625, 3637), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (3633, 3637), True, 'import numpy as np\n'), ((3655, 3667), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (3663, 3667), True, 'import num... |
import path_utils
import numpy as np
from RNN1L import RNN1L
from FFNN_multilayer import FFNN_multilayer
import gym
import matplotlib.pyplot as plt
import os
# Environment setup
#env_name = "CartPole-v0"
env_name = 'Acrobot-v1'
env = gym.make(env_name)
nactions = env.action_space.n
ninputs = env.reset().size
# Networ... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"gym.make",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"path_utils.get_output_dir",
"numpy.mean",
"FFNN_multilayer.FFNN_multilayer",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((235, 253), 'gym.make', 'gym.make', (['env_name'], {}), '(env_name)\n', (243, 253), False, 'import gym\n'), ((366, 400), 'FFNN_multilayer.FFNN_multilayer', 'FFNN_multilayer', (['ninputs', 'nactions'], {}), '(ninputs, nactions)\n', (381, 400), False, 'from FFNN_multilayer import FFNN_multilayer\n'), ((2497, 2557), 'ma... |
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
from collections import Iterable
from torch.autograd import Variable
import torch
import numpy as np
from torchdiffeq import odeint
from models.bnn import BNN
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class O... | [
"torch.nn.ReLU",
"torch.nn.ConvTranspose2d",
"torch.nn.init.kaiming_normal_",
"torch.sum",
"torch.nn.Conv2d",
"torch.nn.init.xavier_normal_",
"torch.cat",
"torch.randn",
"torch.exp",
"torch.nn.BatchNorm2d",
"torchdiffeq.odeint",
"torch.cuda.is_available",
"numpy.linspace",
"torch.nn.Linear... | [((274, 299), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (297, 299), False, 'import torch\n'), ((661, 716), 'models.bnn.BNN', 'BNN', (['(256 + 16)', '(256)'], {'act': '"""tanh"""', 'n_hidden': '(128)', 'bnn': '(False)'}), "(256 + 16, 256, act='tanh', n_hidden=128, bnn=False)\n", (664, 716),... |
"""
Written by <NAME>, May 2021, <EMAIL>
Optimizes a force for the study of the time-integrated velocity of a particle on a ring,
with a periodic potential and a constant driving force in the overdamped case.
Uses an Actor-Critic algorithm, with temporal-difference errors calculated using single
time-step segments of... | [
"matplotlib.pyplot.subplot",
"numpy.save",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.copy",
"numpy.zeros",
"math.floor",
"math.sin",
"time.time",
"matplotlib.pyplot.figure",
"numpy.sin",
"numpy.arange",
"numpy.array",
"numpy.cos"
] | [((1182, 1216), 'numpy.zeros', 'np.zeros', (['(parameter_number * 2 + 1)'], {}), '(parameter_number * 2 + 1)\n', (1190, 1216), True, 'import numpy as np\n'), ((1288, 1322), 'numpy.zeros', 'np.zeros', (['(parameter_number * 2 + 1)'], {}), '(parameter_number * 2 + 1)\n', (1296, 1322), True, 'import numpy as np\n'), ((134... |
import numpy as np
from fenics import *
time_factor = 86400.0*365.24
secpera = 86400.0*365.24
class glenFlow(object):
#Computes harmonic mean of diffusion and dislocation creep based ice rheology
R = 8.314
def __init__(self,grain_size=1e-3,*args,**kwargs):
# Parameters in Glen's Flow Law Rheology... | [
"numpy.min",
"numpy.maximum",
"numpy.exp"
] | [((1766, 1788), 'numpy.maximum', 'np.maximum', (['epsII', '(0.0)'], {}), '(epsII, 0.0)\n', (1776, 1788), True, 'import numpy as np\n'), ((2695, 2815), 'numpy.maximum', 'np.maximum', (['(self.yield_strength - (self.yield_strength - self.yield_min) * strain /\n self.crit_strain)', 'self.yield_min'], {}), '(self.yield_... |
import numpy as np
import torch
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
from torchvision import transforms
import scipy.ndimage as nd
import cv2
import PIL.Image
import os, random
import os.path as osp
import pickle
from scipy.spatial import distance
from scipy.stats import norm
imp... | [
"os.mkdir",
"numpy.sum",
"numpy.ones",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"os.path.join",
"matplotlib.pyplot.close",
"numpy.transpose",
"os.path.exists",
"scipy.ndimage.zoom",
"numpy.reshape",
"numpy.random.choice",
"numpy.asarray",
"matplotlib.pyplot.subplots_ad... | [((12848, 12873), 'matplotlib.pyplot.switch_backend', 'plt.switch_backend', (['"""agg"""'], {}), "('agg')\n", (12866, 12873), True, 'import matplotlib.pyplot as plt\n'), ((1451, 1505), 'os.path.join', 'osp.join', (['self.voc12_root', '"""JPEGImages"""', "(name + '.jpg')"], {}), "(self.voc12_root, 'JPEGImages', name + '... |
''' brief description
detailed description
@Time : 2020/2/26 19:16
@Author : <NAME>
@FileName: split_dataset.py
@Software: PyCharm
'''
import numpy as np
import random
all_path_out = "flow2vec.all.c2v"
train_output = "flow2vec.train.c2v"
val_output = "flow2vec.val.c2v"
test_output = "flow2vec.test.c2v"
max_conte... | [
"random.sample",
"numpy.array"
] | [((3173, 3192), 'numpy.array', 'np.array', (['all_paths'], {}), '(all_paths)\n', (3181, 3192), True, 'import numpy as np\n'), ((2685, 2725), 'random.sample', 'random.sample', (['path_context', 'max_context'], {}), '(path_context, max_context)\n', (2698, 2725), False, 'import random\n')] |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 13 11:05:07 2018
@author: Alexandre
"""
###############################################################################
import numpy as np
###############################################################################
from pyro.dynamic import vehicle
from pyro.planning... | [
"pyro.planning.valueiteration.ValueIteration_ND",
"pyro.control.controller.ClosedLoopSystem",
"pyro.planning.discretizer.GridDynamicSystem",
"pyro.dynamic.vehicle.KinematicProtoCarModelwithObstacles",
"pyro.analysis.costfunction.QuadraticCostFunction",
"numpy.array"
] | [((545, 590), 'pyro.dynamic.vehicle.KinematicProtoCarModelwithObstacles', 'vehicle.KinematicProtoCarModelwithObstacles', ([], {}), '()\n', (588, 590), False, 'from pyro.dynamic import vehicle\n'), ((709, 735), 'numpy.array', 'np.array', (['[+3.5, +1, +0.3]'], {}), '([+3.5, +1, +0.3])\n', (717, 735), True, 'import numpy... |
import hashlib
import numpy as np
import tensorflow as tf
import os
import pickle
import time
class Header:
def __init__(self, n: int, prev, w, t, p, timestamp: int):
self.blockNumber = n
self.prevBlockHash = prev
self.weightHash = w
self.testsetHash = t
self.participantHas... | [
"os.mkdir",
"pickle.dump",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Dense",
"model.FLModel",
"time.time",
"pickle.load",
"numpy.array",
"hashlib.sha3_256",
"tensorflow.keras.layers.Flatten"
] | [((5268, 5288), 'model.FLModel', 'FLModel', (['mnist_model'], {}), '(mnist_model)\n', (5275, 5288), False, 'from model import FLModel\n'), ((2202, 2224), 'numpy.array', 'np.array', (['participants'], {}), '(participants)\n', (2210, 2224), True, 'import numpy as np\n'), ((2352, 2370), 'hashlib.sha3_256', 'hashlib.sha3_2... |
import os
import random
import sys
import time
import numpy as np
import torch
from a2c_ppo_acktr import utils
from collections import deque
def learn(shared_list, done_list, rollout_storages, test_q,
done_training, device, agents,
shared_cpu_actor_critics, please_load_model, args):
"""
... | [
"numpy.random.seed",
"torch.manual_seed",
"time.time",
"torch.cuda.manual_seed_all",
"numpy.mean",
"random.seed",
"sys.stdout.flush",
"a2c_ppo_acktr.utils.update_linear_schedule",
"torch.no_grad",
"collections.deque"
] | [((1376, 1404), 'torch.manual_seed', 'torch.manual_seed', (['args.seed'], {}), '(args.seed)\n', (1393, 1404), False, 'import torch\n'), ((1409, 1446), 'torch.cuda.manual_seed_all', 'torch.cuda.manual_seed_all', (['args.seed'], {}), '(args.seed)\n', (1435, 1446), False, 'import torch\n'), ((1451, 1476), 'numpy.random.se... |
from __future__ import print_function
import os, struct, math
import numpy as np
import torch
from glob import glob
import cv2
import torch.nn.functional as F
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mpl_toolkits.mplot3d import Axes3D
from scipy.spatial.transform ... | [
"mpl_toolkits.axes_grid1.make_axes_locatable",
"os.path.join",
"os.makedirs",
"cv2.cvtColor",
"os.path.isdir",
"torch.load",
"numpy.asarray",
"os.path.exists",
"numpy.zeros",
"numpy.expand_dims",
"torch.save",
"os.path.isfile",
"matplotlib.pyplot.figure",
"numpy.array",
"numpy.sqrt",
"... | [((829, 858), 're.compile', 're.compile', (['"""^(\\\\d+)-(\\\\d+)$"""'], {}), "('^(\\\\d+)-(\\\\d+)$')\n", (839, 858), False, 'import re\n'), ((1283, 1319), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_BGR2RGB'], {}), '(img, cv2.COLOR_BGR2RGB)\n', (1295, 1319), False, 'import cv2\n'), ((2235, 2259), 'os.path.is... |
import numpy as np
import os
import time
import random
import pdb
import forecast_lib as fl
import forecast_lib.forecast_training as ft
dropout=False
if dropout:
type_exp = '_dropout'
rho_d = -1
else:
type_exp = ''
rho_d = 1
# experiment parameters
directory = './experiments/ensemble'+type_exp+'/'
m = fl.num_... | [
"numpy.sum",
"os.makedirs",
"forecast_lib.train_and_save_forecaster",
"time.perf_counter",
"forecast_lib.forecast_training.get_sets",
"forecast_lib.forecast_training.get_partition",
"forecast_lib.extract_data"
] | [((427, 457), 'numpy.sum', 'np.sum', (['fl.load_meters'], {'axis': '(1)'}), '(fl.load_meters, axis=1)\n', (433, 457), True, 'import numpy as np\n'), ((674, 693), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (691, 693), False, 'import time\n'), ((1325, 1344), 'time.perf_counter', 'time.perf_counter', ([],... |
""" Tests for turning curve stats"""
import numpy as np
import inspect
from opexebo.analysis import tuning_curve_stats as func
print("=== tests_analysis_turning_curve_stats ===")
###############################################################################
################ MAIN TESTS
##############... | [
"numpy.random.rand",
"inspect.stack",
"opexebo.analysis.tuning_curve_stats"
] | [((531, 549), 'opexebo.analysis.tuning_curve_stats', 'func', (['tuning_curve'], {}), '(tuning_curve)\n', (535, 549), True, 'from opexebo.analysis import tuning_curve_stats as func\n'), ((436, 453), 'numpy.random.rand', 'np.random.rand', (['n'], {}), '(n)\n', (450, 453), True, 'import numpy as np\n'), ((563, 578), 'insp... |
import numpy as np
from scipy.linalg import solve_triangular
from scipy.spatial.distance import cdist
"""
Active Learning Acquisition Functions (2022/02/07, <NAME> (<EMAIL>))
This script contains the following strategies and related functions:
1. Variance Reduction (IMSE)
2. PIMSE
3. Uncertainty Sampling
4... | [
"numpy.full",
"scipy.spatial.distance.cdist",
"numpy.trace",
"numpy.sum",
"scipy.linalg.solve_triangular",
"numpy.triu",
"numpy.argmax",
"numpy.tril",
"numpy.square",
"numpy.zeros",
"numpy.ndim",
"numpy.ones",
"numpy.hstack",
"numpy.where",
"numpy.linalg.inv",
"numpy.var",
"numpy.uni... | [((1433, 1444), 'numpy.zeros', 'np.zeros', (['n'], {}), '(n)\n', (1441, 1444), True, 'import numpy as np\n'), ((1513, 1551), 'scipy.linalg.solve_triangular', 'solve_triangular', (['L', 'k_ref'], {'lower': '(True)'}), '(L, k_ref, lower=True)\n', (1529, 1551), False, 'from scipy.linalg import solve_triangular\n'), ((2131... |
# -*- coding: utf-8 -*-
'''
@author: <NAME>
@email: <EMAIL>
@date: Jan. 28th 2021
'''
import numpy as np
def calculate_BIC(preds, targets, non_zero_term):
'''
calculate BIC
modified the second part
'''
points_num = preds.shape[0]
preds, targets = np.array(preds), np.array(targets)
resid... | [
"numpy.log",
"numpy.array",
"numpy.exp",
"numpy.var"
] | [((276, 291), 'numpy.array', 'np.array', (['preds'], {}), '(preds)\n', (284, 291), True, 'import numpy as np\n'), ((293, 310), 'numpy.array', 'np.array', (['targets'], {}), '(targets)\n', (301, 310), True, 'import numpy as np\n'), ((827, 842), 'numpy.array', 'np.array', (['preds'], {}), '(preds)\n', (835, 842), True, '... |
# Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"mindspore.dataset.vision.py_transforms.Normalize",
"mindspore.dataset.vision.py_transforms.Resize",
"os.path.join",
"random.randint",
"math.ceil",
"random.shuffle",
"os.walk",
"numpy.random.RandomState",
"mindspore.dataset.GeneratorDataset",
"PIL.Image.open",
"mindspore.communication.management... | [((3610, 3714), 'mindspore.dataset.GeneratorDataset', 'ds.GeneratorDataset', (['testA_generator', "['image_A', 'image_B']"], {'shuffle': '(False)', 'num_parallel_workers': '(12)'}), "(testA_generator, ['image_A', 'image_B'], shuffle=False,\n num_parallel_workers=12)\n", (3629, 3714), True, 'import mindspore.dataset ... |
import datetime
import json
import os
import random
import time
import cv2
import numpy as np
import torch
from django.conf import settings
from django.http import HttpResponse, JsonResponse, StreamingHttpResponse
from django.shortcuts import render
from scipy import ndimage
from .models import GardenPlan, PlantSpeci... | [
"numpy.random.seed",
"cv2.putText",
"json.loads",
"django.http.HttpResponse",
"cv2.cvtColor",
"cv2.copyMakeBorder",
"time.sleep",
"numpy.argsort",
"cv2.imread",
"random.random",
"numpy.random.randint",
"datetime.datetime.strptime",
"scipy.ndimage.measurements.center_of_mass",
"cv2.imencode... | [((479, 527), 'os.path.join', 'os.path.join', (['settings.BASE_DIR', '"""img/video.jpg"""'], {}), "(settings.BASE_DIR, 'img/video.jpg')\n", (491, 527), False, 'import os\n'), ((2910, 2930), 'cv2.imread', 'cv2.imread', (['IMG_FILE'], {}), '(IMG_FILE)\n', (2920, 2930), False, 'import cv2\n'), ((2941, 3027), 'cv2.copyMake... |
import numpy as np
import tensorflow as tf
import tt_v2 as tt
from hyperparameter_v2 import *
r_1 = FLAGS.tt_ranks_1
r_2 = FLAGS.tt_ranks_2
input_node=FLAGS.input_node
output_node=FLAGS.output_node
hidden1_node=FLAGS.hidden_node
#TTO_layer1
inp_modes1 = [4,7,7,4]
out_modes1 = [4,4,4,4]
mat_rank1 = [1,r_1,r_1,r_1... | [
"tensorflow.nn.relu",
"numpy.array"
] | [((692, 710), 'tensorflow.nn.relu', 'tf.nn.relu', (['inputs'], {}), '(inputs)\n', (702, 710), True, 'import tensorflow as tf\n'), ((489, 525), 'numpy.array', 'np.array', (['inp_modes1'], {'dtype': 'np.int32'}), '(inp_modes1, dtype=np.int32)\n', (497, 525), True, 'import numpy as np\n'), ((546, 582), 'numpy.array', 'np.... |
import numpy as np
import json
def _network_to_json(network):
weights = list([list(l) for l in l_weights]
for l_weights in network.weights)
biases = list(list(b) for b in network.biases)
return json.dumps({"weights": weights, "biases": biases})
def _json_to_network(json_input):
p... | [
"numpy.array",
"json.loads",
"json.dumps"
] | [((228, 278), 'json.dumps', 'json.dumps', (["{'weights': weights, 'biases': biases}"], {}), "({'weights': weights, 'biases': biases})\n", (238, 278), False, 'import json\n'), ((333, 355), 'json.loads', 'json.loads', (['json_input'], {}), '(json_input)\n', (343, 355), False, 'import json\n'), ((370, 381), 'numpy.array',... |
"""Unittests for the deepblink.metrics module."""
# pylint: disable=missing-function-docstring
from hypothesis import given
from hypothesis import strategies as st
from hypothesis.extra.numpy import arrays
import numpy as np
import pytest
import scipy.spatial
from deepblink.metrics import _f1_at_cutoff
from deepblink... | [
"hypothesis.extra.numpy.arrays",
"deepblink.metrics.euclidean_dist",
"deepblink.metrics.recall_score",
"deepblink.metrics.f1_score",
"deepblink.metrics.offset_euclidean",
"numpy.zeros",
"numpy.ones",
"deepblink.metrics._f1_at_cutoff",
"deepblink.metrics.precision_score",
"deepblink.metrics.linear_... | [((856, 965), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""nfalsepositive, expected_precision"""', '[(2, 0.98), (3, 0.97), (0, 1), (7, 0.93)]'], {}), "('nfalsepositive, expected_precision', [(2, 0.98), (\n 3, 0.97), (0, 1), (7, 0.93)])\n", (879, 965), False, 'import pytest\n'), ((1343, 1449), 'pytest.... |
import osgeo
import gdal
import cv2
# import rasterio
import numpy as np
# from rasterio.plot import show
# Set root dir to save results
root = r'TEST-RESULTS/'
save_path = root + 'THRESH_GDAL.jpeg'
def thresh_gdal(img_path = 'defult', start_thresh_value = 65, step = 50, auto = 'off'):
# Fix image_file_path for q... | [
"numpy.load",
"numpy.save",
"gdal.GetDriverByName",
"cv2.waitKey",
"cv2.imwrite",
"cv2.threshold",
"cv2.destroyAllWindows",
"gdal.Open",
"cv2.imread",
"cv2.imshow"
] | [((415, 434), 'gdal.Open', 'gdal.Open', (['img_path'], {}), '(img_path)\n', (424, 434), False, 'import gdal\n'), ((468, 496), 'gdal.GetDriverByName', 'gdal.GetDriverByName', (['format'], {}), '(format)\n', (488, 496), False, 'import gdal\n'), ((778, 844), 'cv2.imread', 'cv2.imread', (['save_path', '(cv2.IMREAD_LOAD_GDA... |
#!/usr/bin/env python
# Copyright (c) 2016, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list... | [
"rospy.logwarn",
"pylab.ion",
"rospy.Subscriber",
"pylab.array",
"Queue.Queue",
"pylab.arange",
"rospy.get_param",
"rospy.is_shutdown",
"pylab.figure",
"rospy.init_node",
"numpy.array"
] | [((1773, 1788), 'Queue.Queue', 'Queue.Queue', (['(10)'], {}), '(10)\n', (1784, 1788), False, 'import Queue\n'), ((1798, 1809), 'pylab.ion', 'pylab.ion', ([], {}), '()\n', (1807, 1809), False, 'import pylab\n'), ((1824, 1839), 'pylab.figure', 'pylab.figure', (['(1)'], {}), '(1)\n', (1836, 1839), False, 'import pylab\n')... |
import numpy as np
npts = 100
seed = 37
norm = np.random.RandomState(seed).randn(npts)
np.savetxt('normal.csv', norm, delimiter=',')
| [
"numpy.savetxt",
"numpy.random.RandomState"
] | [((90, 135), 'numpy.savetxt', 'np.savetxt', (['"""normal.csv"""', 'norm'], {'delimiter': '""","""'}), "('normal.csv', norm, delimiter=',')\n", (100, 135), True, 'import numpy as np\n'), ((49, 76), 'numpy.random.RandomState', 'np.random.RandomState', (['seed'], {}), '(seed)\n', (70, 76), True, 'import numpy as np\n')] |
class exponential:
def __init__(self, amplitude=50.0, decay=1.0, shift=1.0,
function="enumerate(('a*exp(-bx)',\
'a*exp(-bx)+c',\
'a*(1-exp(-bx))',\
'a*(1-exp(-bx))+c',\
... | [
"numpy.radians",
"numpy.asarray",
"scipy.signal.sawtooth",
"numpy.arcsin",
"numpy.sin",
"numpy.array",
"numpy.exp",
"numpy.linspace",
"numpy.cos",
"numpy.tan",
"scipy.signal.square",
"numpy.arccos",
"numpy.arctan"
] | [((512, 525), 'numpy.asarray', 'np.asarray', (['x'], {}), '(x)\n', (522, 525), True, 'import numpy as np\n'), ((1804, 1824), 'numpy.radians', 'np.radians', (['x_degree'], {}), '(x_degree)\n', (1814, 1824), True, 'import numpy as np\n'), ((3012, 3037), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', 'sample'], {}), '(0... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 30 15:13:51 2019
@author: wzhan
"""
"""
Mask R-CNN
Train on the Synthetic Arabidopsis dataset which based on Leaf Challenging Segmentation
https://data.csiro.au/collections/#collection/CIcsiro:34323v004.
Download the dataset and put it under the ... | [
"argparse.ArgumentParser",
"numpy.ones",
"numpy.argsort",
"numpy.shape",
"mrcnn.model.MaskRCNN",
"os.path.join",
"imgaug.augmenters.GaussianBlur",
"sys.path.append",
"os.path.exists",
"imgaug.augmenters.Flipud",
"numpy.reshape",
"datetime.datetime.now",
"numpy.stack",
"matplotlib.use",
"... | [((950, 969), 'sys.path.append', 'sys.path.append', (['""""""'], {}), "('')\n", (965, 969), False, 'import sys\n'), ((1191, 1216), 'sys.path.append', 'sys.path.append', (['ROOT_DIR'], {}), '(ROOT_DIR)\n', (1206, 1216), False, 'import sys\n'), ((1494, 1537), 'os.path.join', 'os.path.join', (['ROOT_DIR', '"""mask_rcnn_le... |
import random
import itertools
import collections
import numpy as np
import tensorflow as tf
from bot_code.modelHelpers.actions.action_handler import ActionHandler, ActionMap
class SplitActionHandler(ActionHandler):
"""
For the different actions, (input axes and their possible values)
defines... | [
"tensorflow.not_equal",
"tensorflow.abs",
"tensorflow.reshape",
"numpy.zeros",
"tensorflow.constant",
"tensorflow.stack",
"tensorflow.cast",
"tensorflow.tile",
"tensorflow.round",
"numpy.arange",
"numpy.array",
"random.randrange",
"itertools.product",
"tensorflow.equal",
"tensorflow.slic... | [((1135, 1158), 'numpy.arange', 'np.arange', (['(-1)', '(1.5)', '(0.5)'], {}), '(-1, 1.5, 0.5)\n', (1144, 1158), True, 'import numpy as np\n'), ((1175, 1198), 'numpy.arange', 'np.arange', (['(-1)', '(1.5)', '(0.5)'], {}), '(-1, 1.5, 0.5)\n', (1184, 1198), True, 'import numpy as np\n'), ((1214, 1237), 'numpy.arange', 'n... |
import numpy as np
import cv2
import glob
import pickle
import os
from src.utils import check_dir, save_image
import time
import sys
class CameraCalibration:
def __init__(self, chessboardSize, path):
self.path = path
self.showImages = False
self.chessboardSize = chessboardSize
# p... | [
"sys.stdout.write",
"cv2.findChessboardCorners",
"src.undistortion.Undistortion",
"cv2.cvtColor",
"cv2.waitKey",
"numpy.zeros",
"os.path.exists",
"cv2.imshow",
"cv2.imread",
"src.utils.check_dir",
"pickle.load",
"sys.stdout.flush",
"src.utils.save_image",
"cv2.calibrateCamera",
"glob.glo... | [((406, 470), 'numpy.zeros', 'np.zeros', (['(chessboardSize[0] * chessboardSize[1], 3)', 'np.float32'], {}), '((chessboardSize[0] * chessboardSize[1], 3), np.float32)\n', (414, 470), True, 'import numpy as np\n'), ((628, 696), 'os.path.join', 'os.path.join', (["(self.path + '_results')", '"""calibration_results_pickle.... |
import random
import math
import glob
import os
import cv2
import numpy as np
from matplotlib import pyplot as plt
import importlib
import helper
def group_data(identifier):
path = os.path.dirname(os.path.abspath(__file__))
if identifier == "all":
dataset_path = path + "\\..\\..\\img\\train_pitch\\"
... | [
"helper.integrate",
"os.path.abspath",
"helper.write_log",
"numpy.abs",
"numpy.sum",
"numpy.random.randn",
"numpy.std",
"os.walk",
"numpy.clip",
"cv2.adaptiveThreshold",
"cv2.fastNlMeansDenoising",
"cv2.imread",
"numpy.max",
"numpy.mean",
"numpy.float64",
"helper.split_tol",
"glob.gl... | [((1614, 1681), 'glob.glob1', 'glob.glob1', (["(dataset_path + 'e1\\\\test\\\\')", "('note-' + identifier + '*')"], {}), "(dataset_path + 'e1\\\\test\\\\', 'note-' + identifier + '*')\n", (1624, 1681), False, 'import glob\n'), ((1694, 1761), 'glob.glob1', 'glob.glob1', (["(dataset_path + 'f1\\\\test\\\\')", "('note-' +... |
import os
import numpy as np
import torch
from PIL import Image
import torchvision
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
from torchvision.models.detection.mask_rcnn import MaskRCNNPredictor
import sys
sys.path.append('./reference/detection')
from engine import train_one_epo... | [
"torchvision.models.detection.faster_rcnn.FastRCNNPredictor",
"torch.optim.lr_scheduler.StepLR",
"torch.device",
"os.path.join",
"numpy.unique",
"sys.path.append",
"torch.ones",
"torch.utils.data.DataLoader",
"torchvision.models.detection.maskrcnn_resnet50_fpn",
"numpy.max",
"torchvision.models.... | [((246, 286), 'sys.path.append', 'sys.path.append', (['"""./reference/detection"""'], {}), "('./reference/detection')\n", (261, 286), False, 'import sys\n'), ((4639, 4706), 'torchvision.models.detection.maskrcnn_resnet50_fpn', 'torchvision.models.detection.maskrcnn_resnet50_fpn', ([], {'pretrained': '(True)'}), '(pretr... |
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
import numpy as np
try:
xrange
except NameError:
xrange = range
class BinarySage(object):
def __init__(self, filename, ignored_fields=None, num_files=1):
"""
Set up instance variables
"""
#... | [
"h5py.File",
"numpy.abs",
"argparse.ArgumentParser",
"numpy.fromfile",
"numpy.empty",
"numpy.allclose",
"numpy.dtype",
"numpy.zeros",
"numpy.isclose",
"numpy.array",
"numpy.array_equal"
] | [((13674, 13698), 'numpy.array', 'np.array', (['hdf5_redshifts'], {}), '(hdf5_redshifts)\n', (13682, 13698), True, 'import numpy as np\n'), ((18627, 18657), 'numpy.array_equal', 'np.array_equal', (['field1', 'field2'], {}), '(field1, field2)\n', (18641, 18657), True, 'import numpy as np\n'), ((18835, 18884), 'numpy.all... |
# -*- coding: utf-8 -*-
import sys, os
sys.path = [os.path.dirname(__file__), os.path.dirname(os.path.dirname(__file__))] + sys.path
from bottle import route, run, response, request, hook
import scipy.stats as st
import numpy as np
from stac import nonparametric_tests as npt
from stac import parametric_tests as pt
from... | [
"bottle.hook",
"scipy.stats.kstest",
"utils.evaluate_test",
"scipy.stats.shapiro",
"scipy.stats.normaltest",
"os.path.dirname",
"bottle.run",
"bottle.route",
"utils.clean_missing_values",
"traceback.format_exc",
"numpy.asscalar"
] | [((854, 875), 'bottle.hook', 'hook', (['"""after_request"""'], {}), "('after_request')\n", (858, 875), False, 'from bottle import route, run, response, request, hook\n'), ((1308, 1355), 'bottle.route', 'route', (['"""/assistant"""'], {'method': "['POST', 'OPTIONS']"}), "('/assistant', method=['POST', 'OPTIONS'])\n", (1... |
# A Graphical Visualization of Chess Openings
# April 2020
# Provides a colorful multi-level pie chart which shows the popularity of openings after moves
# For more info, go to www.github.com/Destaq/chess_graph
import plotly.graph_objects as go
from collections import Counter
import new_parser
import find_opening
i... | [
"pandas.DataFrame",
"new_parser.parse_games",
"collections.Counter",
"find_opening.create_openings",
"numpy.unique"
] | [((548, 616), 'new_parser.parse_games', 'new_parser.parse_games', (['gammme', 'depth', 'custom_branching', 'color', 'name'], {}), '(gammme, depth, custom_branching, color, name)\n', (570, 616), False, 'import new_parser\n'), ((9006, 9020), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (9018, 9020), True, 'impor... |
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search
import numpy as np
es = Elasticsearch(['localhost'],port=9200)
label_fields = ["title"]
fields = ["title","cast","country","description"]
weight_fields =["title^2","cast^1","country^1","description^3"]
label_id =[]
Similarity_score... | [
"elasticsearch.Elasticsearch",
"numpy.savetxt",
"numpy.argsort",
"elasticsearch_dsl.Search",
"numpy.array"
] | [((106, 145), 'elasticsearch.Elasticsearch', 'Elasticsearch', (["['localhost']"], {'port': '(9200)'}), "(['localhost'], port=9200)\n", (119, 145), False, 'from elasticsearch import Elasticsearch\n'), ((679, 708), 'elasticsearch_dsl.Search', 'Search', ([], {'using': 'es', 'index': 'index'}), '(using=es, index=index)\n',... |
import math
import numpy as np
def quaternion_from_matrix(matrix):
"""Return quaternion from rotation matrix.
>>> R = rotation_matrix(0.123, (1, 2, 3))
>>> q = quaternion_from_matrix(R)
>>> numpy.allclose(q, [0.0164262, 0.0328524, 0.0492786, 0.9981095])
True
"""
q = np.empty((4, ), dtype=np... | [
"numpy.trace",
"math.sqrt",
"numpy.roll",
"numpy.empty",
"numpy.asarray",
"numpy.zeros",
"numpy.ones",
"ur10e_ikfast.PyKinematics",
"numpy.all",
"numpy.array",
"numpy.concatenate"
] | [((296, 328), 'numpy.empty', 'np.empty', (['(4,)'], {'dtype': 'np.float64'}), '((4,), dtype=np.float64)\n', (304, 328), True, 'import numpy as np\n'), ((401, 412), 'numpy.trace', 'np.trace', (['M'], {}), '(M)\n', (409, 412), True, 'import numpy as np\n'), ((1198, 1234), 'numpy.concatenate', 'np.concatenate', (['(pose, ... |
""""
The goal of this module is to give a comprehensive solution to Task 6
from the coding homeworks from the Machine Learning course on coursera.com.
The task is broken down into smaller parts.
"""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pathlib import Path
import readers
import ... | [
"pandas.DataFrame",
"algorithms.extract_features",
"readers.read_vocabulary",
"readers.read_tokens",
"numpy.count_nonzero",
"matplotlib.pyplot.show",
"algorithms.train_svm",
"plots.plot_data",
"numpy.power",
"readers.read_test_data",
"pathlib.Path",
"matplotlib.pyplot.style.use",
"readers.re... | [((359, 384), 'pathlib.Path', 'Path', (['"""../data/data1.mat"""'], {}), "('../data/data1.mat')\n", (363, 384), False, 'from pathlib import Path\n'), ((399, 424), 'pathlib.Path', 'Path', (['"""../data/data2.mat"""'], {}), "('../data/data2.mat')\n", (403, 424), False, 'from pathlib import Path\n'), ((439, 464), 'pathlib... |
"""
Copyright (c) 2016 <NAME> and <NAME>
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, distribu... | [
"sys.stdout.write",
"numpy.std",
"numpy.isnan",
"numpy.max",
"numpy.where",
"numpy.array",
"numpy.min",
"scipy.spatial.distance.pdist",
"numpy.add",
"numpy.ascontiguousarray",
"numpy.unique"
] | [((5945, 5963), 'numpy.array', 'np.array', (['attrtype'], {}), '(attrtype)\n', (5953, 5963), True, 'import numpy as np\n'), ((6047, 6089), 'numpy.ascontiguousarray', 'np.ascontiguousarray', (['cidx'], {'dtype': 'np.int32'}), '(cidx, dtype=np.int32)\n', (6067, 6089), True, 'import numpy as np\n'), ((6165, 6207), 'numpy.... |
# --------------
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
import seaborn as sns
import matplotlib.pyplot as plt
# load the data from dataset
df = pd.read_csv(path)
# visualize the first five rows of the dataset
print(df.head())
# split the dataset into f... | [
"seaborn.heatmap",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.linear_model.Ridge",
"sklearn.metrics.r2_score",
"sklearn.model_selection.cross_val_score",
"sklearn.linear_model.LinearRegression",
"sklearn.preprocessing.PolynomialFeatures",
"matplotlib.pyplot.figure",
"n... | [((205, 222), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (216, 222), True, 'import pandas as pd\n'), ((470, 523), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': '(0.3)', 'random_state': '(6)'}), '(X, y, test_size=0.3, random_state=6)\n', (486, 523), False, ... |
import numpy as np
import qosy as qy
def xxz_chain(L, J_xy, J_z, periodic=False):
"""Construct a 1D XXZ Hamiltonian H = 1/4 \sum_<ij> [J_xy (X_i X_j + Y_i Y_j) + J_z Z_i Z_j]
Parameters
----------
L : int
The length of the chain.
J_xy : float
The coefficient in front of the exc... | [
"numpy.minimum",
"numpy.maximum",
"qosy.convert",
"numpy.zeros_like",
"numpy.abs",
"qosy.diagonalize_quadratic_tightbinding",
"numpy.imag",
"numpy.real",
"qosy.Operator"
] | [((1199, 1230), 'qosy.Operator', 'qy.Operator', (['coeffs', 'op_strings'], {}), '(coeffs, op_strings)\n', (1210, 1230), True, 'import qosy as qy\n'), ((2958, 2989), 'qosy.Operator', 'qy.Operator', (['coeffs', 'op_strings'], {}), '(coeffs, op_strings)\n', (2969, 2989), True, 'import qosy as qy\n'), ((5042, 5073), 'qosy.... |
import os
import csv
import cv2
import imutils
import random
import numpy as np
from pprint import pprint
from collections import Counter
from PIL import Image as Img
from PIL import ImageTk
from random import randint
from Tkinter import *
import Tkinter,tkFileDialog, tkMessageBox
meta_path = "./Tournament_Logs/Meta_In... | [
"cv2.putText",
"csv.reader",
"Tkinter.Tk",
"cv2.waitKey",
"cv2.imwrite",
"cv2.destroyAllWindows",
"Tkinter.Frame",
"numpy.zeros",
"random.choice",
"Tkinter.PhotoImage",
"Tkinter.Label",
"Tkinter.OptionMenu",
"cv2.imread",
"cv2.rectangle",
"imutils.resize",
"collections.Counter",
"cv2... | [((4097, 4109), 'Tkinter.Tk', 'Tkinter.Tk', ([], {}), '()\n', (4107, 4109), False, 'import Tkinter, tkFileDialog, tkMessageBox\n'), ((8756, 8783), 'random.choice', 'random.choice', (['splash_array'], {}), '(splash_array)\n', (8769, 8783), False, 'import random\n'), ((8946, 8969), 'cv2.imread', 'cv2.imread', (['splash_p... |
"""
Global variables for the package
"""
__author__ = 'martinez'
import numpy as np
MAX_FLOAT = np.finfo(np.float).max
NO_CONNECTION = -1
STR_2GT_EL = 'edge_length'
STR_CELL = 'cell_id'
STR_2FIL_LEN = 'fil_len'
STR_2FIL_CT = 'fil_ct'
STR_2FIL_SIN = 'fil_sin'
STR_2FIL_SMO = 'fil_smooth'
STR_2FIL_MC = 'fil_mc'
... | [
"numpy.finfo"
] | [((105, 123), 'numpy.finfo', 'np.finfo', (['np.float'], {}), '(np.float)\n', (113, 123), True, 'import numpy as np\n')] |
import AlphaBase as AlphaBase
import os
import numpy as np
class LanguageSource(object):
""" A class for training data.
"""
def __init__(self, alpha_set: AlphaBase):
""" Constructor, must be constructed after alpha_set is computed.
:param alpha_set: information about the characters used in... | [
"AlphaBase.AlphaBase.load_object_from_file",
"numpy.zeros",
"os.listdir"
] | [((4304, 4346), 'numpy.zeros', 'np.zeros', (['(m, n, n_char)'], {'dtype': 'np.float32'}), '((m, n, n_char), dtype=np.float32)\n', (4312, 4346), True, 'import numpy as np\n'), ((5049, 5098), 'numpy.zeros', 'np.zeros', (['(n_class_id, n_class)'], {'dtype': 'np.float32'}), '((n_class_id, n_class), dtype=np.float32)\n', (5... |
from vocoder.models.fatchord_version import WaveRNN
from vocoder.vocoder_dataset import VocoderDataset, collate_vocoder
from vocoder.distribution import discretized_mix_logistic_loss
from vocoder.display import stream, simple_table
from vocoder.gen_wavernn import gen_testset
from torch.utils.data import DataLoader... | [
"matplotlib.pyplot.title",
"synthesizer.audio.inv_mel_spectrogram",
"torch.nn.MSELoss",
"vocoder.display.stream",
"matplotlib.pyplot.savefig",
"torch.utils.data.DataLoader",
"torch.nn.L1Loss",
"matplotlib.pyplot.imshow",
"numpy.float32",
"time.time",
"torch.save",
"matplotlib.pyplot.figure",
... | [((749, 799), 'torch.tensor', 'torch.tensor', (['(global_step + 1)'], {'dtype': 'torch.float32'}), '(global_step + 1, dtype=torch.float32)\n', (761, 799), False, 'import torch\n'), ((1953, 1965), 'torch.nn.MSELoss', 'nn.MSELoss', ([], {}), '()\n', (1963, 1965), True, 'import torch.nn as nn\n'), ((1984, 1995), 'torch.nn... |
import timeit
import pandas as pd
import matplotlib.pyplot
from sklearn.linear_model import base
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
from line_profiler import LineProfiler
import numpy as np
from utility import ols_lstsq, ols_sklearn
# We learn that
#https://github.com/sc... | [
"pandas.read_pickle",
"numpy.arange",
"line_profiler.LineProfiler",
"sklearn.linear_model.LinearRegression"
] | [((879, 922), 'pandas.read_pickle', 'pd.read_pickle', (['"""generated_ols_data.pickle"""'], {}), "('generated_ols_data.pickle')\n", (893, 922), True, 'import pandas as pd\n'), ((963, 981), 'sklearn.linear_model.LinearRegression', 'LinearRegression', ([], {}), '()\n', (979, 981), False, 'from sklearn.linear_model import... |
# coding: utf-8
from __future__ import division, print_function
__author__ = "adrn <<EMAIL>>"
# Standard library
import os
import logging
# Third-party
import numpy as np
from astropy import log as logger
import gary.potential as gp
# Project
from ... import project_path
from ..core import align_ensemble, compute_... | [
"os.makedirs",
"astropy.log.setLevel",
"numpy.allclose",
"os.path.exists",
"numpy.cross",
"numpy.array",
"numpy.linalg.norm",
"numpy.random.normal",
"os.path.join",
"numpy.vstack"
] | [((334, 364), 'astropy.log.setLevel', 'logger.setLevel', (['logging.DEBUG'], {}), '(logging.DEBUG)\n', (349, 364), True, 'from astropy import log as logger\n'), ((404, 429), 'os.path.exists', 'os.path.exists', (['plot_path'], {}), '(plot_path)\n', (418, 429), False, 'import os\n'), ((435, 457), 'os.makedirs', 'os.maked... |
import os
import numpy as np
import shutil
import random
# todo;构造卷积神经网络
from keras.layers import Dense, Dropout, Convolution2D, MaxPool2D, Flatten
from keras.models import load_model, Sequential
from keras.preprocessing import image
# from data_gen import DataGenerator
from .data_gen import DataGenerator
class CatDo... | [
"keras.models.load_model",
"numpy.argmax",
"random.shuffle",
"keras.layers.MaxPool2D",
"keras.preprocessing.image.img_to_array",
"shutil.rmtree",
"tensorflow.get_default_graph",
"os.path.join",
"os.path.dirname",
"os.path.exists",
"keras.layers.Flatten",
"keras.preprocessing.image.load_img",
... | [((1032, 1093), 'os.path.join', 'os.path.join', (['self.BATH_PATH', '"""static"""', '"""model"""', '"""mymodel.h5"""'], {}), "(self.BATH_PATH, 'static', 'model', 'mymodel.h5')\n", (1044, 1093), False, 'import os\n'), ((1128, 1191), 'os.path.join', 'os.path.join', (['self.BATH_PATH', '"""static"""', '"""model"""', '"""m... |
import numpy as np
import pandas as pd
import vtk
from vtk.util import numpy_support as ns
class BaseArray(object):
def __init__(self, array, type_array=None):
'''
:param array: Receives a pandas DataFrame, or numpy array or vtkDataArray
:param type_array: Receives the vtk data type or a... | [
"vtk.util.numpy_support.get_vtk_array_type",
"vtk.util.numpy_support.numpy_to_vtk",
"numpy.ravel",
"vtk.util.numpy_support.get_vtk_to_numpy_typemap",
"vtk.util.numpy_support.vtk_to_numpy",
"numpy.issubdtype",
"vtk.util.numpy_support.create_vtk_array",
"numpy.array",
"numpy.array_equal",
"numpy.asc... | [((2440, 2467), 'vtk.util.numpy_support.vtk_to_numpy', 'ns.vtk_to_numpy', (['vtk_object'], {}), '(vtk_object)\n', (2455, 2467), True, 'from vtk.util import numpy_support as ns\n'), ((7239, 7265), 'vtk.util.numpy_support.vtk_to_numpy', 'ns.vtk_to_numpy', (['self._vtk'], {}), '(self._vtk)\n', (7254, 7265), True, 'from vt... |
''' This module contains functions necessary to fit a negative binomial
using the maximum likelihood estimator and some numerical analysis
@author: <NAME>
@website: http://www.peterxeno.com
'''
import math
import numpy as np
from scipy.optimize import newton
from scipy.special import digamma
def r_derv(r_var, vec):... | [
"numpy.sum",
"scipy.special.digamma",
"numpy.mean",
"scipy.optimize.newton",
"math.log"
] | [((747, 759), 'numpy.mean', 'np.mean', (['vec'], {}), '(vec)\n', (754, 759), True, 'import numpy as np\n'), ((1477, 1488), 'numpy.sum', 'np.sum', (['vec'], {}), '(vec)\n', (1483, 1488), True, 'import numpy as np\n'), ((1919, 1952), 'scipy.optimize.newton', 'newton', (['r_derv', 'init'], {'args': '(vec,)'}), '(r_derv, i... |
from problem2 import *
import numpy as np
import sys
'''
Unit test 2:
This file includes unit tests for problem2.py.
'''
#-------------------------------------------------------------------------
def test_python_version():
''' ----------- Problem 2 (30 points in total)---------------------'''
assert sy... | [
"numpy.allclose",
"numpy.array",
"numpy.loadtxt"
] | [((547, 567), 'numpy.array', 'np.array', (['[1.0, 2.0]'], {}), '([1.0, 2.0])\n', (555, 567), True, 'import numpy as np\n'), ((573, 593), 'numpy.array', 'np.array', (['[0.1, 0.2]'], {}), '([0.1, 0.2])\n', (581, 593), True, 'import numpy as np\n'), ((645, 663), 'numpy.allclose', 'np.allclose', (['fx', '(0)'], {}), '(fx, ... |
# Created by <NAME> (<EMAIL>)
from pdb import set_trace
import numpy as np
import numpy.linalg as la
from ConfigSpace import ConfigurationSpace
from ConfigSpace.hyperparameters import UniformIntegerHyperparameter
from .model import Model, ModelFactory
#from ..hyper import IntRangeHyperparam
class ARXFactory(ModelF... | [
"ConfigSpace.ConfigurationSpace",
"numpy.linalg.lstsq",
"numpy.copy",
"ConfigSpace.hyperparameters.UniformIntegerHyperparameter",
"numpy.zeros",
"numpy.ones",
"numpy.eye",
"numpy.concatenate"
] | [((961, 981), 'ConfigSpace.ConfigurationSpace', 'ConfigurationSpace', ([], {}), '()\n', (979, 981), False, 'from ConfigSpace import ConfigurationSpace\n'), ((1000, 1085), 'ConfigSpace.hyperparameters.UniformIntegerHyperparameter', 'UniformIntegerHyperparameter', ([], {'name': '"""history"""', 'lower': '(1)', 'upper': '... |
from typing import Optional, Union
import numpy as np
import pandas as pd
from bokeh.io import output_notebook, reset_output
from bokeh.models import Legend, Dropdown, ColumnDataSource, CustomJS
from bokeh.plotting import figure, output_file, show
from bokeh.layouts import column
from bokeh.events import MenuItemClic... | [
"pandas.DataFrame",
"bokeh.models.ColumnDataSource",
"bokeh.plotting.figure",
"bokeh.io.output_notebook",
"bokeh.models.Dropdown",
"bokeh.plotting.output_file",
"bokeh.layouts.column",
"bokeh.io.reset_output",
"numpy.unique"
] | [((1541, 1569), 'pandas.DataFrame', 'pd.DataFrame', (['reduced_points'], {}), '(reduced_points)\n', (1553, 1569), True, 'import pandas as pd\n'), ((2120, 2139), 'numpy.unique', 'np.unique', (['clusters'], {}), '(clusters)\n', (2129, 2139), True, 'import numpy as np\n'), ((2895, 2995), 'bokeh.models.Dropdown', 'Dropdown... |
import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from .planefit import plane_z
def scatter_3d(pcloud, **scatter_kwargs):
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
x = pcloud[:, 0]
y = pcloud[:, 1]
z = pcloud[:, 2]
ax.scatter... | [
"matplotlib.pyplot.figure",
"numpy.meshgrid",
"matplotlib.pyplot.show",
"numpy.arange"
] | [((181, 193), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (191, 193), True, 'from matplotlib import pyplot as plt\n'), ((353, 363), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (361, 363), True, 'from matplotlib import pyplot as plt\n'), ((447, 468), 'numpy.arange', 'np.arange', (['a', 'b', '... |
from os.path import exists
import pandas as pd
import numpy as np
from scripts.progress_bar.progress_bar import printProgressBar
def check_one_file(file_path, index, l):
printProgressBar(index, l, prefix = 'Progress:', suffix = 'Complete', length = 50)
return exists(file_path)
def concatenate(row, other_row):... | [
"scripts.progress_bar.progress_bar.printProgressBar",
"os.path.exists",
"pandas.read_csv",
"numpy.vectorize"
] | [((175, 251), 'scripts.progress_bar.progress_bar.printProgressBar', 'printProgressBar', (['index', 'l'], {'prefix': '"""Progress:"""', 'suffix': '"""Complete"""', 'length': '(50)'}), "(index, l, prefix='Progress:', suffix='Complete', length=50)\n", (191, 251), False, 'from scripts.progress_bar.progress_bar import print... |
"""
Implementation of the original DQN Nature paper:
https://storage.googleapis.com/deepmind-media/dqn/DQNNaturePaper.pdf
Some of the complexity is captured via wrappers but the main components such as the DQN model itself,
the training loop, the memory-efficient replay buffer are implemented from ... | [
"utils.utils.get_env_wrapper",
"utils.utils.LinearSchedule",
"copy.deepcopy",
"models.definitions.DQN.DQN",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"os.path.join",
"matplotlib.pyplot.imshow",
"time.time",
"utils.utils.set_random_seeds",
"numpy.mean",
"torch.cuda.is_available",
"... | [((8979, 9018), 'utils.utils.get_env_wrapper', 'utils.get_env_wrapper', (["config['env_id']"], {}), "(config['env_id'])\n", (9000, 9018), True, 'import utils.utils as utils\n'), ((9039, 9134), 'utils.replay_buffer.ReplayBuffer', 'ReplayBuffer', (["config['replay_buffer_size']"], {'crash_if_no_mem': "config['dont_crash_... |
from datetime import datetime
import spacy
import pandas
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.tensorboard import SummaryWriter
import numpy as np
import matplotlib.pyplot as plt
# torch geometric libraries
from torch_geometric.loader import DataLoader
from torch_geometric... | [
"networkx.set_node_attributes",
"torch_geometric.utils.to_networkx",
"time.time",
"networkx.relabel_nodes",
"spacy.load",
"networkx.connected_components",
"numpy.array",
"networkx.write_gexf",
"os.listdir",
"torch.tensor"
] | [((615, 643), 'spacy.load', 'spacy.load', (['"""en_core_web_lg"""'], {}), "('en_core_web_lg')\n", (625, 643), False, 'import spacy\n'), ((786, 797), 'time.time', 'time.time', ([], {}), '()\n', (795, 797), False, 'import time\n'), ((1683, 1694), 'time.time', 'time.time', ([], {}), '()\n', (1692, 1694), False, 'import ti... |
# -*- coding: utf-8 -*-
import PyMca5
from PyMca5.PyMcaPhysics.xrf import McaAdvancedFitBatch
from PyMca5.PyMcaPhysics.xrf import FastXRFLinearFit
from PyMca5.PyMcaPhysics.xrf import ClassMcaTheory
from PyMca5.PyMca import EDFStack
from PyMca5.PyMcaIO import ConfigDict
try:
from PyMca5.PyMcaPhysics.xrf.McaAdvance... | [
"numpy.sum",
"numpy.arange",
"glob.glob",
"os.path.join",
"PyMca5.PyMcaPhysics.xrf.McaAdvancedFitBatch.McaAdvancedFitBatch",
"PyMca5.PyMcaPhysics.xrf.ClassMcaTheory.McaTheory",
"PyMca5.PyMca.EDFStack.EDFStack",
"numpy.isfinite",
"numpy.append",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.subpl... | [((806, 833), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (823, 833), False, 'import logging\n'), ((899, 934), 'PyMca5.PyMcaIO.ConfigDict.ConfigDict', 'ConfigDict.ConfigDict', ([], {'filelist': 'cfg'}), '(filelist=cfg)\n', (920, 934), False, 'from PyMca5.PyMcaIO import ConfigDict\n'), ... |
from __future__ import absolute_import
from __future__ import print_function
import theano
import theano.tensor as T
import numpy as np
import warnings
import time
from collections import deque
from .utils.generic_utils import Progbar
class CallbackList(object):
def __init__(self, callbacks, queue_length=10):
... | [
"numpy.median",
"warnings.warn",
"collections.deque",
"time.time"
] | [((903, 938), 'collections.deque', 'deque', (['[]'], {'maxlen': 'self.queue_length'}), '([], maxlen=self.queue_length)\n', (908, 938), False, 'from collections import deque\n'), ((974, 1009), 'collections.deque', 'deque', (['[]'], {'maxlen': 'self.queue_length'}), '([], maxlen=self.queue_length)\n', (979, 1009), False,... |
"""
Implement the pipeline to generate data
"""
import subprocess
from multiprocessing import Process, Queue
import argparse
from scripts.ml_scene_gen import scene_gen
from scripts.data_gen_util import toml_dict
import numpy as np
import os
def main(args):
#scene_gen(args.NP, args.sp, args.path)
# genera... | [
"subprocess.run",
"scripts.data_gen_util.toml_dict",
"argparse.ArgumentParser",
"os.path.exists",
"scripts.ml_scene_gen.scene_gen",
"multiprocessing.Process",
"numpy.round"
] | [((2038, 2063), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2061, 2063), False, 'import argparse\n'), ((1531, 1553), 'numpy.round', 'np.round', (['(args.NP / NP)'], {}), '(args.NP / NP)\n', (1539, 1553), True, 'import numpy as np\n'), ((1653, 1702), 'multiprocessing.Process', 'Process', ([]... |
"""
Version: 1.0
Last modified on: 17 November, 2014
Developers: <NAME>, <NAME>.
email: eduardo_(DOT)_luis_(AT)_aluno_(DOT)_ufabc_(DOT)_edu_(DOT)_br
: folivetti_(AT)_ufabc_(DOT)_edu_(DOT)_br
Based on source-code by <NAME> and <NAME>
available at http://goanna.cs.rmit.edu.au/~xiaodong/cec15-niching... | [
"numpy.array",
"numpy.ones"
] | [((502, 517), 'numpy.ones', 'np.ones', (['[1, 2]'], {}), '([1, 2])\n', (509, 517), True, 'import numpy as np\n'), ((552, 572), 'numpy.array', 'np.array', (['[1.9, 1.1]'], {}), '([1.9, 1.1])\n', (560, 572), True, 'import numpy as np\n'), ((625, 640), 'numpy.ones', 'np.ones', (['[1, 2]'], {}), '([1, 2])\n', (632, 640), T... |
"""
Copyright 2017 The Johns Hopkins University Applied Physics Laboratory LLC
and <NAME>
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/license... | [
"numpy.load",
"numpy.argmax",
"random.sample",
"random.shuffle",
"keras.models.Model",
"collections.defaultdict",
"cv2.warpAffine",
"numpy.random.randint",
"numpy.mean",
"numpy.sin",
"keras.layers.Input",
"keras.layers.ConvLSTM2D",
"keras.layers.concatenate",
"keras.preprocessing.image.ran... | [((10477, 10518), 'keras.models.Model', 'Model', ([], {'inputs': 'inputs', 'outputs': 'predictions'}), '(inputs=inputs, outputs=predictions)\n', (10482, 10518), False, 'from keras.models import Sequential, Model\n'), ((11220, 11232), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (11230, 11232), False, 'fro... |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 2 14:45:30 2018
@author: <NAME>
"""
from scipy import optimize
from scipy import stats
import numpy as np
class SuPP:
def __init__(self,k = 1,options=None):
if options is None:
options = {'un_classes':0,
'nr_classes':0,#comes... | [
"numpy.sum",
"numpy.abs",
"numpy.triu",
"numpy.ones",
"numpy.isnan",
"numpy.shape",
"numpy.histogram",
"numpy.linalg.norm",
"numpy.unique",
"numpy.repeat",
"numpy.nansum",
"numpy.log2",
"numpy.dot",
"numpy.nanmax",
"numpy.nanquantile",
"numpy.zeros",
"numpy.nanmin",
"numpy.array",
... | [((1287, 1298), 'numpy.shape', 'np.shape', (['X'], {}), '(X)\n', (1295, 1298), True, 'import numpy as np\n'), ((1760, 1789), 'numpy.zeros', 'np.zeros', (["[k, self.opts['M']]"], {}), "([k, self.opts['M']])\n", (1768, 1789), True, 'import numpy as np\n'), ((2872, 2896), 'numpy.zeros', 'np.zeros', (["[1, opts['n']]"], {}... |
from typing import Any, Dict
import numpy as np
import pandas as pd
from statsmodels.tsa.arima.model import ARIMA
from module.detector.Detector import Detector
class ArimaDetector(Detector):
def __init__(self, dataset: pd.DataFrame, ground_truth_outliers: np.ndarray,
configuration_name: str, )... | [
"numpy.argwhere",
"statsmodels.tsa.arima.model.ARIMA"
] | [((587, 605), 'statsmodels.tsa.arima.model.ARIMA', 'ARIMA', (['x'], {}), '(x, **params)\n', (592, 605), False, 'from statsmodels.tsa.arima.model import ARIMA\n'), ((757, 789), 'numpy.argwhere', 'np.argwhere', (['self.outliers_array'], {}), '(self.outliers_array)\n', (768, 789), True, 'import numpy as np\n')] |
# This source code is part of the Biotite package and is distributed
# under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
# information.
import numpy as np
import pytest
import biotite.sequence as seq
import biotite.sequence.align as align
K = 3
@pytest.fixture
def kmer_alphabet():
return ali... | [
"biotite.sequence.align.KmerAlphabet",
"numpy.random.seed"
] | [((372, 389), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (386, 389), True, 'import numpy as np\n'), ((1099, 1116), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (1113, 1116), True, 'import numpy as np\n'), ((317, 368), 'biotite.sequence.align.KmerAlphabet', 'align.KmerAlphabet', (['... |
"""
Join
=====
Some examples of how joining works.
"""
import numpy as np
from matplotlib import pyplot as plt
import WrightTools as wt
a = wt.data.Data(name="a")
b = wt.data.Data(name="b")
a.create_variable("x", np.linspace(0, 10, 51)[:, None])
b.create_variable("x", np.linspace(5, 15, 51)[:, None])
a.create_variabl... | [
"matplotlib.pyplot.subplot",
"WrightTools.artists.corner_text",
"WrightTools.artists.create_figure",
"WrightTools.data.join",
"WrightTools.data.Data",
"numpy.sin",
"numpy.exp",
"numpy.linspace",
"WrightTools.artists.set_fig_labels",
"numpy.cos"
] | [((142, 164), 'WrightTools.data.Data', 'wt.data.Data', ([], {'name': '"""a"""'}), "(name='a')\n", (154, 164), True, 'import WrightTools as wt\n'), ((169, 191), 'WrightTools.data.Data', 'wt.data.Data', ([], {'name': '"""b"""'}), "(name='b')\n", (181, 191), True, 'import WrightTools as wt\n'), ((622, 656), 'WrightTools.d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.