code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
"""
===================================
Masked Normalized Cross-Correlation
===================================
In this example, we use the masked normalized cross-correlation to identify the relative shift
between two similar images containing invalid data.
In this case, the images cannot simply be masked before com... | [
"matplotlib.pyplot.subplot",
"scipy.ndimage.shift",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure",
"skimage.feature.masked_register_translation",
"numpy.random.choice",
"skimage.data.camera"
] | [((968, 981), 'skimage.data.camera', 'data.camera', ([], {}), '()\n', (979, 981), False, 'from skimage import data\n'), ((1319, 1384), 'numpy.random.choice', 'np.random.choice', (['[False, True]'], {'size': 'image.shape', 'p': '[0.25, 0.75]'}), '([False, True], size=image.shape, p=[0.25, 0.75])\n', (1335, 1384), True, ... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy.spatial import Voronoi, voronoi_plot_2d
from ReadSvgPath import ReadSvgPath
"""
Map_names: Svg files you want to add the voronoi from (Lot of differents svg maps are available from Wikipedia)
Location_names = Csv files you want to create... | [
"scipy.spatial.voronoi_plot_2d",
"matplotlib.pyplot.show",
"pandas.read_csv",
"ReadSvgPath.ReadSvgPath",
"scipy.spatial.Voronoi",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.figure",
"numpy.array",
"matplotlib.pyplot.savefig"
] | [((1658, 1670), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1668, 1670), True, 'import matplotlib.pyplot as plt\n'), ((1731, 1766), 'ReadSvgPath.ReadSvgPath', 'ReadSvgPath', (["(mapsvg + '.svg')", 'ax', '(0)'], {}), "(mapsvg + '.svg', ax, 0)\n", (1742, 1766), False, 'from ReadSvgPath import ReadSvgPath... |
import numpy as np
from keras import backend as K
import cv2 as cv
from PIL import Image
from typing import Tuple
from timeit import default_timer as timer
from .yolo import YOLO
from .utils import letterbox_image
def detect_image(yolo, image: Image) -> Tuple[np.ndarray, np.ndarray]:
start = timer()
if yo... | [
"cv2.putText",
"keras.backend.learning_phase",
"cv2.cvtColor",
"timeit.default_timer",
"numpy.asarray",
"numpy.empty",
"cv2.imshow",
"cv2.waitKey",
"cv2.rectangle",
"cv2.destroyAllWindows",
"cv2.namedWindow"
] | [((302, 309), 'timeit.default_timer', 'timer', ([], {}), '()\n', (307, 309), True, 'from timeit import default_timer as timer\n'), ((981, 1074), 'numpy.empty', 'np.empty', (['(1, image_data_width, image_data_height, image_data_channels)'], {'dtype': 'np.float32'}), '((1, image_data_width, image_data_height, image_data_... |
import numpy as np
def retrieve_random_state(random_seed):
""" Returns a random state if the seed is not a random state.
"""
if not random_seed:
r = np.random.RandomState(None)
elif type(random_seed) == np.random.RandomState:
r = random_seed
else:
r = np.random.RandomState(r... | [
"numpy.random.RandomState"
] | [((170, 197), 'numpy.random.RandomState', 'np.random.RandomState', (['None'], {}), '(None)\n', (191, 197), True, 'import numpy as np\n'), ((297, 331), 'numpy.random.RandomState', 'np.random.RandomState', (['random_seed'], {}), '(random_seed)\n', (318, 331), True, 'import numpy as np\n')] |
"""
@author: <NAME>
Citation: for more information about GANS check this repository: https://github.com/uclaacmai/Generative-Adversarial-Network-Tutorial/blob/master
"""
import tensorflow as tf
import random
import numpy as np
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
... | [
"tensorflow.trainable_variables",
"tensorflow.nn.tanh",
"tensorflow.constant_initializer",
"tensorflow.reset_default_graph",
"tensorflow.reshape",
"tensorflow.get_variable_scope",
"tensorflow.zeros_like",
"tensorflow.matmul",
"tensorflow.nn.conv2d",
"tensorflow.nn.conv2d_transpose",
"tensorflow.... | [((328, 368), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['"""MNIST_data/"""'], {}), "('MNIST_data/')\n", (353, 368), False, 'from tensorflow.examples.tutorials.mnist import input_data\n'), ((451, 475), 'random.randint', 'random.randint', (['(0)', '(55000)'], {}), '(0... |
import numpy as np
from typing import List, Tuple
from configparser import ConfigParser
from logging import Logger
from utils.datatypes import Line, Section
class Clusterer(object):
'''Take a set of text lines and try to figure out how they are structured in sections and paragraphs'''
def __init__(self, conf... | [
"utils.datatypes.Section",
"numpy.histogram",
"numpy.array",
"numpy.arange"
] | [((1216, 1230), 'numpy.array', 'np.array', (['gaps'], {}), '(gaps)\n', (1224, 1230), True, 'import numpy as np\n'), ((1246, 1270), 'numpy.arange', 'np.arange', (['(0)', '(0.1)', '(0.005)'], {}), '(0, 0.1, 0.005)\n', (1255, 1270), True, 'import numpy as np\n'), ((1294, 1323), 'numpy.histogram', 'np.histogram', (['gaps']... |
import streamlit as st
import awesome_streamlit as ast
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.cluster import KMeans
from sklearn.metrics import pairwise_distances_argmin_min
from io import BytesIO
from kneed import KneeLocator
from ..helpers import ge... | [
"streamlit.text_input",
"streamlit.image",
"pandas.read_csv",
"streamlit.title",
"matplotlib.pyplot.style.use",
"streamlit.subheader",
"sklearn.cluster.KMeans",
"streamlit.text",
"matplotlib.pyplot.subplots",
"io.BytesIO",
"streamlit.error",
"streamlit.set_option",
"seaborn.scatterplot",
"... | [((342, 397), 'streamlit.set_option', 'st.set_option', (['"""deprecation.showPyplotGlobalUse"""', '(False)'], {}), "('deprecation.showPyplotGlobalUse', False)\n", (355, 397), True, 'import streamlit as st\n'), ((458, 492), 'streamlit.title', 'st.title', (['"""Clustering Particional"""'], {}), "('Clustering Particional'... |
# Copyright 2015 <NAME>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | [
"numpy.zeros",
"numpy.nonzero",
"numpy.sin",
"numpy.linalg.norm",
"numpy.cos",
"numpy.random.rand"
] | [((1752, 1783), 'numpy.zeros', 'np.zeros', (['(self.ambient_dim, 1)'], {}), '((self.ambient_dim, 1))\n', (1760, 1783), True, 'import numpy as np\n'), ((1657, 1679), 'numpy.nonzero', 'np.nonzero', (['sample_vec'], {}), '(sample_vec)\n', (1667, 1679), True, 'import numpy as np\n'), ((1897, 1921), 'numpy.linalg.norm', 'np... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
RIXS data reader for beamline BM23 @ ESRF
=========================================
.. note: RIXS stands for Resonant Inelastic X-ray Scattering
"""
import os
import time
import numpy as np
from silx.io.dictdump import dicttoh5
from sloth.utils.bragg import ang2kev... | [
"os.remove",
"numpy.ones_like",
"sloth.utils.bragg.ang2kev",
"numpy.append",
"os.path.isfile",
"numpy.array",
"sloth.utils.logging.getLogger",
"os.path.join",
"os.access",
"time.localtime"
] | [((431, 456), 'sloth.utils.logging.getLogger', 'getLogger', (['"""io_rixs_bm23"""'], {}), "('io_rixs_bm23')\n", (440, 456), False, 'from sloth.utils.logging import getLogger\n'), ((2477, 2501), 'os.path.isfile', 'os.path.isfile', (['macro_in'], {}), '(macro_in)\n', (2491, 2501), False, 'import os\n'), ((2506, 2534), 'o... |
from typing import Sequence, Tuple
import numpy as np
import attr
from vkit.image.type import VImage
from vkit.label.type import VPoint
from .grid_rendering.interface import PointProjector
from .grid_rendering.grid_creator import create_src_image_grid
from .interface import GeometricDistortionImageGridBased, StateIma... | [
"numpy.stack",
"vkit.label.type.VPoint",
"numpy.sum",
"numpy.asarray",
"numpy.square",
"vkit.opt.get_data_folder",
"numpy.zeros",
"numpy.errstate",
"numpy.expand_dims",
"vkit.image.type.VImage.from_file",
"numpy.array",
"numpy.matmul",
"moviepy.editor.ImageSequenceClip"
] | [((5073, 5098), 'vkit.opt.get_data_folder', 'get_data_folder', (['__file__'], {}), '(__file__)\n', (5088, 5098), False, 'from vkit.opt import get_data_folder\n'), ((6628, 6653), 'vkit.opt.get_data_folder', 'get_data_folder', (['__file__'], {}), '(__file__)\n', (6643, 6653), False, 'from vkit.opt import get_data_folder\... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "l... | [
"timeout.timeout",
"sagemaker.utils.sagemaker_timestamp",
"numpy.zeros",
"timeout.timeout_and_delete_endpoint",
"os.path.join",
"sagemaker.mxnet.estimator.MXNet"
] | [((957, 993), 'os.path.join', 'os.path.join', (['RESOURCE_PATH', '"""mnist"""'], {}), "(RESOURCE_PATH, 'mnist')\n", (969, 993), False, 'import os\n'), ((1012, 1047), 'os.path.join', 'os.path.join', (['data_path', '"""mnist.py"""'], {}), "(data_path, 'mnist.py')\n", (1024, 1047), False, 'import os\n'), ((1058, 1339), 's... |
# convlstm model
import numpy as np
import csv
import tensorflow as tf
import matplotlib.pyplot as plt
import matplotlib as mpl
# load a single file as a numpy array
def load_file(filepath):
data = []
with open(filepath) as csvfile:
reader = csv.reader(csvfile, delimiter=',')
for row in reader:... | [
"csv.reader",
"tensorflow.keras.layers.Dense",
"matplotlib.pyplot.boxplot",
"tensorflow.keras.layers.ConvLSTM2D",
"numpy.mean",
"tensorflow.keras.Sequential",
"matplotlib.pyplot.gca",
"tensorflow.keras.layers.Flatten",
"numpy.std",
"matplotlib.ticker.MaxNLocator",
"tensorflow.keras.utils.plot_mo... | [((4716, 4726), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (4724, 4726), True, 'import matplotlib.pyplot as plt\n'), ((361, 375), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (369, 375), True, 'import numpy as np\n'), ((654, 671), 'numpy.dstack', 'np.dstack', (['loaded'], {}), '(loaded)\n', (663,... |
"""
@autor <NAME>
This project is to apply the knowledge learned in the course "Artificial Intelligence" in edx.org
I've implemented uninformed search BFS, DFS and informed search A* and IDA
Note:
The problem is called n-puzzle. You have an input state and using a search algorithm, the program
should find the m... | [
"math.sqrt",
"time.time",
"numpy.array",
"numpy.reshape",
"multiprocessing.Queue"
] | [((15413, 15443), 'numpy.reshape', 'np.reshape', (['aux', '(-1, nro_col)'], {}), '(aux, (-1, nro_col))\n', (15423, 15443), True, 'import numpy as np\n'), ((2573, 2600), 'math.sqrt', 'math.sqrt', (['self.values.size'], {}), '(self.values.size)\n', (2582, 2600), False, 'import math\n'), ((3327, 3351), 'numpy.array', 'np.... |
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
def crop(image, return_array=False, shape=(3, 3), plot=True, figsize=(10, 10)):
"""
Slice image into multiple images.
Params:
image: str/pathlib object, image directory
return_array: bool, if true, return sliced i... | [
"numpy.column_stack",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots",
"PIL.Image.open"
] | [((579, 596), 'PIL.Image.open', 'Image.open', (['image'], {}), '(image)\n', (589, 596), False, 'from PIL import Image\n'), ((804, 865), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'nrows': 'shape[0]', 'ncols': 'shape[1]', 'figsize': 'figsize'}), '(nrows=shape[0], ncols=shape[1], figsize=figsize)\n', (816, 865),... |
import pandas as pd
import numpy as np
import glob
import data.normalise as nm
from data.duplicates import group_duplicates
from data.features import compute_features
nw_features_disc = {
'Time': {
'func': nm.change_time,
'input': 'time'
},
'Date': {
'func': nm.has_dates,
'input': 'message'
},
'Number': ... | [
"pandas.read_csv",
"numpy.savetxt",
"data.duplicates.group_duplicates",
"numpy.append",
"glob.glob",
"pandas.concat",
"data.normalise.number_words"
] | [((540, 575), 'glob.glob', 'glob.glob', (["('data/raw_db' + '/*.csv')"], {}), "('data/raw_db' + '/*.csv')\n", (549, 575), False, 'import glob\n'), ((716, 737), 'pandas.concat', 'pd.concat', (['li'], {'axis': '(0)'}), '(li, axis=0)\n', (725, 737), True, 'import pandas as pd\n'), ((888, 931), 'pandas.read_csv', 'pd.read_... |
from matplotlib import pyplot as plt
from matplotlib.animation import FuncAnimation
from matplotlib.colors import TwoSlopeNorm
import numpy as np
from directorios import *
def visualizacion(*args, tipo, guardar, path, file, nombre, **kwargs):
if 'xlabel' not in kwargs:
xlabel = ' '
else:
xlabe... | [
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.title",
"matplotlib.pyplot.yscale",
"numpy.meshgrid",
"matplotlib.pyplot.xlim",
"numpy.amin",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.colorbar",
"numpy.amax",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gca",
"numpy.random.rand",
"matplo... | [((1599, 1668), 'matplotlib.pyplot.plot', 'plt.plot', (['X', 'Y'], {'color': 'color', 'linestyle': 'linestyle', 'linewidth': 'linewidth'}), '(X, Y, color=color, linestyle=linestyle, linewidth=linewidth)\n', (1607, 1668), True, 'from matplotlib import pyplot as plt\n'), ((1677, 1708), 'matplotlib.pyplot.xlabel', 'plt.xl... |
import logging
import torch.nn.functional as F
from torch.distributions import Normal
import numpy as np
import torch
from demotivational_policy_descent.agents.agent_interface import AgentInterface
from demotivational_policy_descent.utils.utils import discount_rewards, softmax_sample
class Policy(torch.nn.Module):
... | [
"torch.mean",
"logging.debug",
"torch.stack",
"numpy.argmax",
"torch.nn.init.uniform_",
"numpy.zeros",
"torch.nn.Linear",
"torch.sigmoid",
"torch.std",
"torch.exp",
"torch.Tensor",
"demotivational_policy_descent.utils.utils.discount_rewards",
"torch.nn.functional.relu",
"torch.nn.init.zero... | [((5250, 5269), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (5267, 5269), False, 'import logging\n'), ((523, 555), 'torch.nn.Linear', 'torch.nn.Linear', (['state_space', '(50)'], {}), '(state_space, 50)\n', (538, 555), False, 'import torch\n'), ((579, 612), 'torch.nn.Linear', 'torch.nn.Linear', (['(50)'... |
import numpy as np
import pandas as pd
import plotly.graph_objects as go
from grade_rank_calculation import calculate_grade_rank
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output, State
from dash.excepti... | [
"dash_html_components.H2",
"dash_core_components.Input",
"dash_core_components.Tab",
"numpy.round",
"dash_html_components.H3",
"dash.Dash",
"dash_html_components.Label",
"pandas.merge",
"dash.dependencies.State",
"numpy.linspace",
"grade_rank_calculation.calculate_grade_rank",
"plotly.graph_ob... | [((375, 436), 'pandas.read_pickle', 'pd.read_pickle', (['"""RouteQualityData.pkl.zip"""'], {'compression': '"""zip"""'}), "('RouteQualityData.pkl.zip', compression='zip')\n", (389, 436), True, 'import pandas as pd\n'), ((606, 621), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (611, 621), False, 'from fla... |
from itertools import chain
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from cytoolz import valmap
from matplotlib.collections import PatchCollection
from matplotlib.patches import Rectangle
from .base import DataFusionModel
def fusion_diagram(
model: DataFusionM... | [
"numpy.random.seed",
"matplotlib.patches.Rectangle",
"matplotlib.pyplot.clf",
"cytoolz.valmap",
"pandas.notnull",
"itertools.chain",
"matplotlib.collections.PatchCollection",
"matplotlib.pyplot.subplots"
] | [((1095, 1113), 'numpy.random.seed', 'np.random.seed', (['(98)'], {}), '(98)\n', (1109, 1113), True, 'import numpy as np\n'), ((1266, 1275), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (1273, 1275), True, 'import matplotlib.pyplot as plt\n'), ((1861, 1928), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {... |
'''
Created on Feb 2, 2020
@author: miim
'''
from dataPrep import loadData,sequenceData, plot_series
import numpy as np
import tensorflow as tf
from tensorflow.keras.layers import LSTM,Conv1D,Dense,MaxPooling1D,Flatten,Dropout
from tensorflow.keras.models import Sequential
from math import sqrt
from sklearn.metrics i... | [
"tensorflow.keras.layers.Dropout",
"dataPrep.sequenceData",
"tensorflow.keras.layers.Conv1D",
"tensorflow.keras.layers.Dense",
"numpy.asarray",
"tensorflow.keras.layers.MaxPooling1D",
"dataPrep.loadData",
"numpy.append",
"tensorflow.keras.layers.LSTM",
"tensorflow.keras.models.Sequential",
"nump... | [((404, 445), 'dataPrep.loadData', 'loadData', (['"""data/Sunspots.csv"""', '(3000)', '(0)', '(2)'], {}), "('data/Sunspots.csv', 3000, 0, 2)\n", (412, 445), False, 'from dataPrep import loadData, sequenceData, plot_series\n'), ((710, 742), 'dataPrep.sequenceData', 'sequenceData', (['train', 'window_size'], {}), '(train... |
"""
Tests module series
# Author: <NAME>
# $Id$
"""
from __future__ import unicode_literals
from __future__ import division
#from past.utils import old_div
__version__ = "$Revision$"
import os
from copy import copy, deepcopy
import unittest
import numpy
import numpy.testing as np_test
import scipy
from pyto.tomo... | [
"unittest.TextTestRunner",
"os.getcwd",
"pyto.tomo.series.Series.readTiltAngles",
"numpy.testing.assert_almost_equal",
"pyto.tomo.series.Series",
"unittest.TestLoader",
"numpy.testing.assert_equal",
"os.path.split",
"os.path.join"
] | [((523, 534), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (532, 534), False, 'import os\n'), ((560, 583), 'os.path.split', 'os.path.split', (['__file__'], {}), '(__file__)\n', (573, 583), False, 'import os\n'), ((603, 638), 'os.path.join', 'os.path.join', (['working_dir', 'file_dir'], {}), '(working_dir, file_dir)\n', ... |
### Python wrappers for R functions ###
import rpy2.robjects as robjects
import numpy as np
import os
# Set source
r_source = robjects.r['source']
# Set working directory for R
dir_path = os.path.dirname(os.path.realpath(__file__))
dir_path = dir_path.replace('\\','/')
robjects.r("setwd('{}')".format(dir_path))
... | [
"os.path.realpath",
"rpy2.robjects.r",
"numpy.min",
"numpy.array",
"rpy2.robjects.FloatVector",
"numpy.cov"
] | [((211, 237), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (227, 237), False, 'import os\n'), ((715, 739), 'rpy2.robjects.FloatVector', 'robjects.FloatVector', (['mu'], {}), '(mu)\n', (735, 739), True, 'import rpy2.robjects as robjects\n'), ((750, 773), 'rpy2.robjects.FloatVector', 'robje... |
import shutil
import subprocess
import matplotlib.pyplot as plt
from pathlib import Path
#from multiprocessing import Pool, cpu_count
import os
import logging
from nipype.interfaces.ants.segmentation import N4BiasFieldCorrection
from nilearn.plotting import plot_anat
from scipy.signal import medfilt
from sklearn.cluste... | [
"pathlib.Path",
"matplotlib.pyplot.figure",
"numpy.histogram",
"numpy.mean",
"numpy.interp",
"numpy.round",
"numpy.unique",
"subprocess.check_call",
"nilearn.plotting.plot_anat",
"numpy.multiply",
"numpy.copy",
"matplotlib.pyplot.imshow",
"sklearn.cluster.KMeans",
"scipy.signal.medfilt",
... | [((407, 502), 'nilearn.plotting.plot_anat', 'plot_anat', (['img'], {'title': 'title', 'display_mode': '"""ortho"""', 'dim': '(-1)', 'draw_cross': '(False)', 'annotate': '(False)'}), "(img, title=title, display_mode='ortho', dim=-1, draw_cross=False,\n annotate=False)\n", (416, 502), False, 'from nilearn.plotting imp... |
# -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the... | [
"amct_tensorflow.create_quant_config",
"tensorflow.compat.v1.GraphDef",
"numpy.fromfile",
"os.path.dirname",
"amct_tensorflow.save_model",
"tensorflow.compat.v1.global_variables_initializer",
"logging.info",
"tensorflow.compat.v1.Session",
"numpy.reshape",
"tensorflow.Graph",
"tensorflow.import_... | [((979, 989), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (987, 989), True, 'import tensorflow as tf\n'), ((1197, 1231), 'os.path.dirname', 'os.path.dirname', (['output_graph_file'], {}), '(output_graph_file)\n', (1212, 1231), False, 'import os\n'), ((1250, 1287), 'os.path.join', 'os.path.join', (['base_dir', '""... |
import argparse
import re
from collections import namedtuple
import numpy as np
import prettytable as pt
from scipy.stats import sem
TableMetricProps = namedtuple('MetricProps', ['header', 'format'])
METRIC_INFO = {
'psnr': TableMetricProps('PSNR \u25B2', '{:.2f}'),
'ssim': TableMetricProps('SSIM \u25B2', '... | [
"numpy.load",
"argparse.ArgumentParser",
"numpy.mean",
"numpy.where",
"collections.namedtuple",
"prettytable.PrettyTable",
"scipy.stats.sem",
"re.sub"
] | [((155, 202), 'collections.namedtuple', 'namedtuple', (['"""MetricProps"""', "['header', 'format']"], {}), "('MetricProps', ['header', 'format'])\n", (165, 202), False, 'from collections import namedtuple\n'), ((1391, 1407), 'prettytable.PrettyTable', 'pt.PrettyTable', ([], {}), '()\n', (1405, 1407), True, 'import pret... |
import random, torch, os
import collections
from operator import itemgetter
import argparse, datetime
import numpy as np
from torch.autograd import Variable
import torch.optim as optim
import torch.nn.functional as F
from model.dda import *
from utils.dataload import data_generator
from utils.write_csv import *
from u... | [
"numpy.random.seed",
"argparse.ArgumentParser",
"torch.cat",
"torch.no_grad",
"torch.load",
"os.path.exists",
"random.seed",
"collections.Counter",
"datetime.datetime.now",
"numpy.ceil",
"torch.manual_seed",
"utils.dataload.data_generator",
"torch.autograd.Variable",
"torch.cuda.manual_see... | [((354, 410), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Sequence Modeling"""'}), "(description='Sequence Modeling')\n", (377, 410), False, 'import argparse, datetime\n'), ((2358, 2381), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (2379, 2381), False, 'import ... |
import apiprocessing
import pandas as pd
import numpy as np
from collections import deque
datax = deque()
for story in apiprocessing.stories:
x = list()
x.append(story.title)
x.append(story.source.name)
x.append(story.published_at.date())
x.append(story.sentiment.title.score)
x.append(story.se... | [
"pandas.DataFrame",
"numpy.array",
"collections.deque"
] | [((99, 106), 'collections.deque', 'deque', ([], {}), '()\n', (104, 106), False, 'from collections import deque\n'), ((491, 506), 'numpy.array', 'np.array', (['datax'], {}), '(datax)\n', (499, 506), True, 'import numpy as np\n'), ((515, 530), 'numpy.array', 'np.array', (['datax'], {}), '(datax)\n', (523, 530), True, 'im... |
import numpy as np
from Data import Data
"""
CS383: Hw6
Instructor: <NAME>
TAs: <NAME>, <NAME>
University of Massachusetts, Amherst
README:
Feel free to make use of the function/libraries imported
You are NOT allowed to import anything else.
Following is a skeleton code which follows a Scikit style API.
Make necess... | [
"Data.Data",
"numpy.argmax"
] | [((5361, 5367), 'Data.Data', 'Data', ([], {}), '()\n', (5365, 5367), False, 'from Data import Data\n'), ((4279, 4299), 'numpy.argmax', 'np.argmax', (['InfoGains'], {}), '(InfoGains)\n', (4288, 4299), True, 'import numpy as np\n')] |
'''
Function for embedding interactive plots and adding links, etc.
'''
from pathlib import Path
import numpy as np
from .utils import datetime_from_msname
def return_webserver_link():
'''
Return a link to the webserver home page.
'''
return "../"
def generate_webserver_track_link(flagging_sheet... | [
"numpy.array_split",
"pathlib.Path"
] | [((3139, 3151), 'pathlib.Path', 'Path', (['folder'], {}), '(folder)\n', (3143, 3151), False, 'from pathlib import Path\n'), ((3873, 3885), 'pathlib.Path', 'Path', (['folder'], {}), '(folder)\n', (3877, 3885), False, 'from pathlib import Path\n'), ((13047, 13059), 'pathlib.Path', 'Path', (['folder'], {}), '(folder)\n', ... |
import numpy as np
import pandas as pd
import pygeos
import pytest
from shapely.geometry import Point
from analyzer.methods.density_calculator import _get_num_peds_per_frame, compute_classic_density
from tests.utils.utils import get_trajectory, get_trajectory_data
@pytest.mark.parametrize(
"measurement_area, ped... | [
"shapely.geometry.Point",
"analyzer.methods.density_calculator._get_num_peds_per_frame",
"pygeos.polygons",
"analyzer.methods.density_calculator.compute_classic_density",
"pygeos.area",
"numpy.array",
"pygeos.to_shapely",
"tests.utils.utils.get_trajectory_data",
"pytest.mark.parametrize"
] | [((1902, 2000), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""num_peds_row, num_peds_col, num_frames"""', '[(4, 5, 100), (1, 1, 200)]'], {}), "('num_peds_row, num_peds_col, num_frames', [(4, 5, \n 100), (1, 1, 200)])\n", (1925, 2000), False, 'import pytest\n'), ((733, 756), 'numpy.array', 'np.array', (... |
import unittest
from francis import model_adaptor
import pandas as pd
import numpy as np
from numpy.testing import assert_array_equal
import librosa
def noisy_audio(seconds):
return np.random.uniform(low=-1.0, high=1.0, size=(seconds * 22050,))
def make_spectrogram(seconds):
return np.reshape(
libro... | [
"pandas.DataFrame",
"numpy.random.uniform",
"numpy.testing.assert_array_equal",
"francis.model_adaptor.adapt_spectrograms",
"francis.model_adaptor.adapt_predictions",
"francis.model_adaptor.adapt",
"numpy.shape"
] | [((188, 250), 'numpy.random.uniform', 'np.random.uniform', ([], {'low': '(-1.0)', 'high': '(1.0)', 'size': '(seconds * 22050,)'}), '(low=-1.0, high=1.0, size=(seconds * 22050,))\n', (205, 250), True, 'import numpy as np\n'), ((603, 793), 'pandas.DataFrame', 'pd.DataFrame', (["{'label': ['CommonBlackbird', 'Wren', 'Chic... |
import tensorflow as tf
import numpy as np
import argparse
import pickle
parser = argparse.ArgumentParser()
parser.add_argument('len',
type=int,
help='Constitution length (in word)')
parser.add_argument('--seed',
type=str,
help='seed word... | [
"argparse.ArgumentParser",
"tensorflow.train.import_meta_graph",
"tensorflow.Session",
"numpy.array",
"tensorflow.Graph"
] | [((83, 108), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (106, 108), False, 'import argparse\n'), ((1476, 1486), 'tensorflow.Graph', 'tf.Graph', ([], {}), '()\n', (1484, 1486), True, 'import tensorflow as tf\n'), ((1492, 1522), 'tensorflow.Session', 'tf.Session', ([], {'graph': 'loaded_graph... |
from flask import Flask, render_template, request, jsonify, url_for
import atexit
import os
import json
import folium
from botocore.client import Config
import ibm_boto3
import pandas as pd
import ast
from collections import namedtuple
import numpy as np
class ProvinceMap:
def __init__(self, province_mapping):
... | [
"numpy.arctan2",
"pandas.read_csv",
"numpy.sin",
"folium.Map",
"pandas.DataFrame",
"flask.request.args.get",
"flask.render_template",
"numpy.linspace",
"numpy.radians",
"numpy.cos",
"os.getenv",
"folium.RegularPolygonMarker",
"folium.map.Marker",
"json.load",
"flask.Flask",
"pandas.rea... | [((5423, 5458), 'flask.Flask', 'Flask', (['__name__'], {'static_url_path': '""""""'}), "(__name__, static_url_path='')\n", (5428, 5458), False, 'from flask import Flask, render_template, request, jsonify, url_for\n'), ((956, 973), 'pandas.read_csv', 'pd.read_csv', (['body'], {}), '(body)\n', (967, 973), True, 'import p... |
import pandas as pd
import numpy as np
import numpy.lib.recfunctions as rf
from . import plt
class PlotHist:
"""
class to plot histograms for a set of OS
Parameters
---------------
dbDir: str
loca. directory of the files
forPlot: pandas df
configuration parameters
"""
de... | [
"pandas.DataFrame",
"numpy.load",
"numpy.cumsum",
"numpy.max",
"numpy.min",
"numpy.arange",
"pandas.concat",
"numpy.unique"
] | [((375, 389), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (387, 389), True, 'import pandas as pd\n'), ((1282, 1308), 'numpy.arange', 'np.arange', (['(22.0)', '(27.0)', '(0.1)'], {}), '(22.0, 27.0, 0.1)\n', (1291, 1308), True, 'import numpy as np\n'), ((1327, 1357), 'numpy.unique', 'np.unique', (["self.data['d... |
import os
import open3d.ml as _ml3d
import open3d.ml.torch as ml3d
from open3d.ml.vis import Visualizer, BoundingBox3D, LabelLUT
from tqdm import tqdm
import numpy as np
import matplotlib.pyplot as plt
cfg_file = "ml3d/configs/pointpillars_kitti.yml"
cfg = _ml3d.utils.Config.load_from_file(cfg_file)
model = ml3d.mode... | [
"open3d.ml.torch.pipelines.ObjectDetection",
"os.makedirs",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"numpy.fromfile",
"os.path.exists",
"os.system",
"open3d.ml.utils.Config.load_from_file",
"open3d.ml.torch.models.PointPillars"
] | [((258, 301), 'open3d.ml.utils.Config.load_from_file', '_ml3d.utils.Config.load_from_file', (['cfg_file'], {}), '(cfg_file)\n', (291, 301), True, 'import open3d.ml as _ml3d\n'), ((311, 348), 'open3d.ml.torch.models.PointPillars', 'ml3d.models.PointPillars', ([], {}), '(**cfg.model)\n', (335, 348), True, 'import open3d.... |
#!/usr/bin/env python
# coding: utf-8
import os
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.style.use('ggplot')
from geometric.molecule import Molecule
from torsiondrive.tools import read_scan_xyz
def plot_1d_curve(grid_data, filename):
"""
Plot torsiondriv... | [
"matplotlib.pyplot.title",
"argparse.ArgumentParser",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.Figure",
"matplotlib.pyplot.style.use",
"matplotlib.use",
"numpy.array",
"os.path.splitext",
"torsiondrive.tools.read_scan_xyz",
"matplotlib.pyplot.ylabel",
"matplotlib... | [((86, 107), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (100, 107), False, 'import matplotlib\n'), ((140, 163), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (153, 163), True, 'import matplotlib.pyplot as plt\n'), ((1073, 1085), 'matplotlib.pyplot.Fig... |
from __future__ import print_function
import unittest
import numpy as np
from scipy.sparse import csr_matrix
from implicit.evaluation import train_test_split
class EvaluationTest(unittest.TestCase):
def _get_sample_matrix(self):
return csr_matrix((np.random.random((10, 10)) > 0.5).astype(np.float64))
... | [
"unittest.main",
"implicit.evaluation.train_test_split",
"numpy.random.randint",
"numpy.random.random"
] | [((639, 654), 'unittest.main', 'unittest.main', ([], {}), '()\n', (652, 654), False, 'import unittest\n'), ((361, 384), 'numpy.random.randint', 'np.random.randint', (['(1000)'], {}), '(1000)\n', (378, 384), True, 'import numpy as np\n'), ((447, 479), 'implicit.evaluation.train_test_split', 'train_test_split', (['mat', ... |
from __future__ import print_function, division
import numpy as np
import tensorflow as tf
from netlearner.utils import min_max_scale
from netlearner.utils import measure_prediction
from preprocess import unsw
from keras.regularizers import l2
from keras.models import Model
from keras.utils import multi_gpu_model
from ... | [
"keras.regularizers.l2",
"numpy.load",
"pickle.dump",
"numpy.argmax",
"numpy.argmin",
"keras.models.Model",
"numpy.mean",
"preprocess.unsw.generate_dataset",
"keras.layers.Input",
"matplotlib.pyplot.close",
"netlearner.utils.min_max_scale",
"matplotlib.pyplot.subplots",
"keras.utils.multi_gp... | [((2658, 2702), 'preprocess.unsw.generate_dataset', 'unsw.generate_dataset', (['(True)', '(True)', 'model_dir'], {}), '(True, True, model_dir)\n', (2679, 2702), False, 'from preprocess import unsw\n'), ((2907, 2946), 'numpy.load', 'np.load', (["(data_dir + 'train_dataset.npy')"], {}), "(data_dir + 'train_dataset.npy')\... |
import os
import keras
from keras.models import Sequential
from keras.layers import Dense, Conv2D, Dropout, Flatten, MaxPooling2D
from keras.utils import np_utils
from keras import regularizers
import cv2
import os
from keras.layers import Input
from keras.models import Model
from keras.layers.normalization import Batc... | [
"numpy.random.seed",
"os.path.basename",
"keras.callbacks.ModelCheckpoint",
"keras.layers.Dropout",
"numpy.asarray",
"keras.layers.core.Activation",
"keras.layers.MaxPooling2D",
"keras.layers.Flatten",
"keras.models.Model",
"cv2.imread",
"keras.utils.np_utils.to_categorical",
"keras.callbacks.... | [((1279, 1299), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (1293, 1299), True, 'import numpy as np\n'), ((4487, 4508), 'numpy.asarray', 'np.asarray', (['y_train_1'], {}), '(y_train_1)\n', (4497, 4508), True, 'import numpy as np\n'), ((4520, 4540), 'numpy.asarray', 'np.asarray', (['y_test_1'], {}... |
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as stat
from numba import jit
a=7**5 #moltiplier
m=2**31-1 #modulus
n_bins=100 #number of bins
@jit(nopython=True) #high performance Python compiler
def MINSTD(seed): #define MINSTD generator
r= (a*seed) % m
n=[np.uint32(s... | [
"numpy.uint32",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylim",
"numpy.histogram",
"matplotlib.pyplot.figure",
"numba.jit",
"matplotlib.pyplot.ticklabel_format",
"numpy.linspace",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((176, 194), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (179, 194), False, 'from numba import jit\n'), ((709, 737), 'numpy.histogram', 'np.histogram', (['x'], {'bins': 'n_bins'}), '(x, bins=n_bins)\n', (721, 737), True, 'import numpy as np\n'), ((812, 824), 'matplotlib.pyplot.figure', 'plt.... |
import numpy as np
from baselines.ecbp.agents.buffer.lru_knn_combine_bp import LRU_KNN_COMBINE_BP
from baselines.ecbp.agents.buffer.lru_knn_combine_bp_2 import LRU_KNN_COMBINE_BP_2
from baselines.ecbp.agents.buffer.lru_knn_prioritizedsweeping import LRU_KNN_PRIORITIZEDSWEEPING
from baselines.ecbp.agents.buffer.lru_knn_... | [
"numpy.zeros",
"copy.copy",
"time.time",
"numpy.max",
"numpy.random.randint",
"numpy.random.random",
"numpy.array",
"numpy.where",
"numpy.squeeze",
"logging.getLogger"
] | [((1102, 1136), 'logging.getLogger', 'logging.getLogger', (['args.agent_name'], {}), '(args.agent_name)\n', (1119, 1136), False, 'import logging\n'), ((1416, 1427), 'time.time', 'time.time', ([], {}), '()\n', (1425, 1427), False, 'import time\n'), ((3467, 3478), 'time.time', 'time.time', ([], {}), '()\n', (3476, 3478),... |
import numpy as np
import attr
from parametric import Attribute
from optimistic.algorithms import Algorithm
@attr.s
class GradientDescent(Algorithm):
iterations = Attribute('iterations', 100, converter=int)
learning_rate = Attribute('learning_rate', 1e-3, converter=float)
dither_size = Attribute('dither_si... | [
"parametric.Attribute",
"numpy.zeros"
] | [((168, 211), 'parametric.Attribute', 'Attribute', (['"""iterations"""', '(100)'], {'converter': 'int'}), "('iterations', 100, converter=int)\n", (177, 211), False, 'from parametric import Attribute\n'), ((232, 282), 'parametric.Attribute', 'Attribute', (['"""learning_rate"""', '(0.001)'], {'converter': 'float'}), "('l... |
#!/usr/bin/env python
# coding: utf-8
import pathlib
import pandas as pd
import numpy as np
import multiprocessing as mp
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from clearCNV import util
from clearCNV import cnv_arithmetics as ca
def cnv_calling(args):
# argparsing
intsv_path = ... | [
"matplotlib.pyplot.title",
"pandas.read_csv",
"clearCNV.cnv_arithmetics.load_cnvs_from_df",
"matplotlib.pyplot.figure",
"pathlib.Path",
"multiprocessing.cpu_count",
"pandas.DataFrame",
"clearCNV.util.normalize_within_sample",
"matplotlib.pyplot.close",
"sklearn.cluster.KMeans",
"clearCNV.util.se... | [((1019, 1050), 'clearCNV.util.load_dataframe', 'util.load_dataframe', (['intsv_path'], {}), '(intsv_path)\n', (1038, 1050), False, 'from clearCNV import util\n'), ((1069, 1154), 'pandas.read_csv', 'pd.read_csv', (['matchscores_path'], {'sep': '"""\t"""', 'low_memory': '(False)', 'header': '(0)', 'index_col': '(0)'}), ... |
# tests speed of solving systems of linear equations
import numpy as np
import time
import matplotlib.pyplot as plt
counts = []
times = []
for count in range(2, 1024):
a = np.random.rand(count, count)
b = np.random.rand(count)
start = time.time()
x = np.linalg.solve(a, b)
dt = time.time() - start
... | [
"matplotlib.pyplot.plot",
"matplotlib.pyplot.waitforbuttonpress",
"time.time",
"matplotlib.pyplot.figure",
"numpy.random.rand",
"numpy.linalg.solve"
] | [((434, 460), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8, 4)'}), '(figsize=(8, 4))\n', (444, 460), True, 'import matplotlib.pyplot as plt\n'), ((460, 483), 'matplotlib.pyplot.plot', 'plt.plot', (['counts', 'times'], {}), '(counts, times)\n', (468, 483), True, 'import matplotlib.pyplot as plt\n'), ((... |
import json
import logging
import os
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import numpy as np
import os.path as osp
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
JSON_CONTENT_TYPE = 'application/json'
logger = logging.getLogger(__name__)
def m... | [
"json.loads",
"numpy.argmax",
"numpy.array2string",
"logging.getLogger",
"json.dumps",
"torch.nn.functional.softmax",
"transformers.AutoTokenizer.from_pretrained",
"torch.cuda.is_available",
"transformers.AutoModelForSequenceClassification.from_pretrained",
"torch.nn.functional.log_softmax",
"to... | [((286, 313), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (303, 313), False, 'import logging\n'), ((414, 578), 'transformers.AutoModelForSequenceClassification.from_pretrained', 'AutoModelForSequenceClassification.from_pretrained', (['"""allenai/scibert_scivocab_uncased"""'], {'num_lab... |
#!/usr/bin/env python
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from fermat_spiral import fermat
from fermat_spiral import fermat_scale
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("n", help="Number of points",... | [
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"matplotlib.pyplot.plot",
"fermat_spiral.fermat",
"numpy.random.normal",
"fermat_spiral.fermat_scale",
"numpy.sqrt"
] | [((241, 266), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (264, 266), False, 'import argparse\n'), ((1145, 1177), 'fermat_spiral.fermat', 'fermat', (['n'], {'a': 'a', 'b': 'b', 'theta': 'theta'}), '(n, a=a, b=b, theta=theta)\n', (1151, 1177), False, 'from fermat_spiral import fermat\n'), ((1... |
from .summarizer import Summarizer
from .utils import build_summary, get_keyword_sentences, get_top_sentences
# Various matrix/neural network modules
import numpy as np
from transformers import AutoModel, AutoTokenizer
import torch
from torch.nn.utils.rnn import pad_sequence
# Cosine similarity (embeddings d... | [
"scipy.spatial.distance.cosine",
"sklearn.cluster.KMeans",
"torch.cat",
"transformers.AutoModel.from_pretrained",
"transformers.AutoTokenizer.from_pretrained",
"numpy.where",
"torch.nn.utils.rnn.pad_sequence",
"torch.tensor"
] | [((696, 728), 'transformers.AutoModel.from_pretrained', 'AutoModel.from_pretrained', (['model'], {}), '(model)\n', (721, 728), False, 'from transformers import AutoModel, AutoTokenizer\n'), ((755, 791), 'transformers.AutoTokenizer.from_pretrained', 'AutoTokenizer.from_pretrained', (['model'], {}), '(model)\n', (784, 79... |
import numpy as np
import modin.pandas as pd
from pandas.util.testing import assert_equal
from greykite.common.features.timeseries_impute import impute_with_lags
from greykite.common.features.timeseries_impute import impute_with_lags_multi
def test_impute_with_lags():
"""Testing `impute_with_lags`"""
# below... | [
"greykite.common.features.timeseries_impute.impute_with_lags",
"greykite.common.features.timeseries_impute.impute_with_lags_multi",
"pandas.util.testing.assert_equal",
"numpy.testing.assert_array_equal",
"numpy.array",
"modin.pandas.DataFrame"
] | [((577, 662), 'greykite.common.features.timeseries_impute.impute_with_lags', 'impute_with_lags', ([], {'df': 'df', 'value_col': '"""y"""', 'orders': '[7]', 'agg_func': 'np.mean', 'iter_num': '(1)'}), "(df=df, value_col='y', orders=[7], agg_func=np.mean, iter_num=1\n )\n", (593, 662), False, 'from greykite.common.fea... |
import argparse
import json
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from utils import parse_robot_string
def plot_hof_morph_stats(hall_of_fame_file, morphologies_file, res_dir, seed):
#... | [
"matplotlib.rc",
"json.load",
"os.path.abspath",
"os.makedirs",
"argparse.ArgumentParser",
"numpy.sum",
"matplotlib.pyplot.close",
"numpy.asarray",
"matplotlib.pyplot.setp",
"matplotlib.pyplot.figure",
"utils.parse_robot_string",
"numpy.min",
"numpy.max",
"numpy.linspace",
"os.path.join"... | [((366, 409), 'os.path.join', 'os.path.join', (['res_dir', '"""hall_of_fame_stats"""'], {}), "(res_dir, 'hall_of_fame_stats')\n", (378, 409), False, 'import os\n'), ((414, 455), 'os.makedirs', 'os.makedirs', (['hof_stats_dir'], {'exist_ok': '(True)'}), '(hof_stats_dir, exist_ok=True)\n', (425, 455), False, 'import os\n... |
#!/usr/bin/python3
# number of output figures = 2
import matplotlib as mpl
import numpy as np
from helper.figure import Figure
import helper.grid
import helper.plot
import helper.topo_opt
def main():
for q in range(2):
if q == 0:
width, height, scale = 1.5, 0.75, 4/3
xt, yt = [0, width], [0, heig... | [
"helper.figure.Figure.create",
"numpy.ones",
"numpy.insert",
"numpy.append",
"numpy.array",
"numpy.reshape",
"numpy.vstack"
] | [((715, 755), 'helper.figure.Figure.create', 'Figure.create', ([], {'figsize': '(3, 3)', 'scale': '(0.9)'}), '(figsize=(3, 3), scale=0.9)\n', (728, 755), False, 'from helper.figure import Figure\n'), ((1644, 1680), 'numpy.reshape', 'np.reshape', (['XXYY[:, 0]', '(nn[::-1] + 1)'], {}), '(XXYY[:, 0], nn[::-1] + 1)\n', (1... |
# --------------------------------------------------------------------------------
# Copyright (c) 2018 <NAME>(<NAME>). All rights reserved.
#
# 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 ... | [
"maya.api.OpenMaya.MPxNode.addAttribute",
"maya.api.OpenMaya.MFnNumericAttribute",
"numpy.zeros_like",
"maya.api.OpenMaya.MFnMeshData",
"maya.api.OpenMaya.MPxNode.__init__",
"maya.api.OpenMaya.MFnPlugin",
"maya.api.OpenMaya.MFnMesh",
"numpy.hstack",
"maya.api.OpenMaya.MPxNode.attributeAffects",
"n... | [((1752, 1771), 'maya.api.OpenMaya.MTypeId', 'om.MTypeId', (['(1070208)'], {}), '(1070208)\n', (1762, 1771), True, 'import maya.api.OpenMaya as om\n'), ((51207, 51224), 'maya.api.OpenMaya.MFnPlugin', 'om.MFnPlugin', (['obj'], {}), '(obj)\n', (51219, 51224), True, 'import maya.api.OpenMaya as om\n'), ((51526, 51543), 'm... |
import ctypes
import os
import numpy
from .helpers import *
from HSTB.time import UTC
import HSTPBin
install_path = HSTPBin.__path__[0]
os.chdir(install_path)
dll = ctypes.CDLL(os.path.join(install_path, r'hips_io_sdku.dll'))
dll.HIPSIO_Init(ctypes.c_wchar_p(""), 0)
#from HSTPBin.PyPeekXTF import TideErrorFile
de... | [
"ctypes.c_double",
"ctypes.c_int",
"numpy.shape",
"numpy.argsort",
"numpy.mean",
"os.path.join",
"os.chdir",
"numpy.set_printoptions",
"os.path.exists",
"ctypes.pointer",
"ctypes.c_uint",
"os.access",
"HSTB.time.UTC.UTCs80ToDateTime",
"ctypes.POINTER",
"ctypes.c_wchar_p",
"ctypes.cast"... | [((139, 161), 'os.chdir', 'os.chdir', (['install_path'], {}), '(install_path)\n', (147, 161), False, 'import os\n'), ((180, 226), 'os.path.join', 'os.path.join', (['install_path', '"""hips_io_sdku.dll"""'], {}), "(install_path, 'hips_io_sdku.dll')\n", (192, 226), False, 'import os\n'), ((245, 265), 'ctypes.c_wchar_p', ... |
import numpy as np
np.set_printoptions(suppress=True)
import matplotlib.pyplot as plt
from ex1 import gradient_descent, plot_cost_history
# Second data to analyse, this one has three dimensions -> linear regression with multiple variables
## Import data
data = np.loadtxt("ex1data2.txt", delimiter=",")
X = data[:, ... | [
"numpy.set_printoptions",
"numpy.std",
"numpy.zeros",
"numpy.ones",
"numpy.mean",
"numpy.matrix.transpose",
"numpy.loadtxt",
"numpy.matmul",
"numpy.linalg.inv",
"numpy.array",
"ex1.gradient_descent",
"ex1.plot_cost_history"
] | [((19, 53), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'suppress': '(True)'}), '(suppress=True)\n', (38, 53), True, 'import numpy as np\n'), ((265, 306), 'numpy.loadtxt', 'np.loadtxt', (['"""ex1data2.txt"""'], {'delimiter': '""","""'}), "('ex1data2.txt', delimiter=',')\n", (275, 306), True, 'import numpy as... |
import os
import sys
import math
import numpy as np
import pytest
import unittest
from geopyspark.geotrellis import Extent, ProjectedExtent, Tile
from geopyspark.geotrellis.layer import RasterLayer
from geopyspark.geotrellis.constants import LayerType, NO_DATA_INT, ClassificationStrategy
from geopyspark.tests.base_tes... | [
"unittest.main",
"numpy.fill_diagonal",
"math.isnan",
"geopyspark.tests.base_test_class.BaseTestClass.pysc._gateway.close",
"pytest.fixture",
"numpy.zeros",
"geopyspark.tests.base_test_class.BaseTestClass.pysc.parallelize",
"numpy.ones",
"numpy.identity",
"pytest.raises",
"pytest.mark.skipif",
... | [((422, 450), 'geopyspark.geotrellis.Extent', 'Extent', (['(0.0)', '(0.0)', '(10.0)', '(10.0)'], {}), '(0.0, 0.0, 10.0, 10.0)\n', (428, 450), False, 'from geopyspark.geotrellis import Extent, ProjectedExtent, Tile\n'), ((474, 508), 'geopyspark.geotrellis.ProjectedExtent', 'ProjectedExtent', (['extent', 'epsg_code'], {}... |
import numpy as np
import cv2
from sklearn.decomposition import PCA
def draw_keypoints(img, kpts, color=(0, 255, 0), radius=4, s=3):
img = np.uint8(img)
if s != 1:
img = cv2.resize(img, None, fx=s, fy=s)
if len(img.shape) == 2:
img = img[..., np.newaxis]
if img.shape[-1] == 1:
... | [
"cv2.line",
"numpy.uint8",
"cv2.circle",
"numpy.unique",
"numpy.min",
"numpy.max",
"sklearn.decomposition.PCA",
"numpy.random.randint",
"numpy.int32",
"numpy.array",
"numpy.round",
"cv2.resize",
"numpy.repeat"
] | [((145, 158), 'numpy.uint8', 'np.uint8', (['img'], {}), '(img)\n', (153, 158), True, 'import numpy as np\n'), ((361, 375), 'numpy.int32', 'np.int32', (['kpts'], {}), '(kpts)\n', (369, 375), True, 'import numpy as np\n'), ((2213, 2251), 'sklearn.decomposition.PCA', 'PCA', ([], {'n_components': '(3)', 'svd_solver': '"""f... |
# Copyright 2018 <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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" file accompanying this fil... | [
"numpy.random.seed",
"logging.basicConfig",
"contextlib.ExitStack",
"logging.info",
"pathlib.Path",
"boto3.resource",
"random.seed"
] | [((880, 919), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (899, 919), False, 'import logging\n'), ((956, 983), 'pathlib.Path', 'Path', (["os.environ['S3_PATH']"], {}), "(os.environ['S3_PATH'])\n", (960, 983), False, 'from pathlib import Path\n'), ((1048, 1088... |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"rdkit.Chem.MolFromSmarts",
"numpy.zeros",
"numpy.ones",
"itertools.combinations",
"rdkit.Chem.rdmolops.FastFindRings",
"itertools.product",
"functools.reduce"
] | [((896, 932), 'numpy.zeros', 'np.zeros', (['[max_value]'], {'dtype': 'np.bool'}), '([max_value], dtype=np.bool)\n', (904, 932), True, 'import numpy as np\n'), ((1347, 1382), 'numpy.zeros', 'np.zeros', (['array_size'], {'dtype': 'np.bool'}), '(array_size, dtype=np.bool)\n', (1355, 1382), True, 'import numpy as np\n'), (... |
# Copyright 2020 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.context.set_context",
"mindspore.ops.operations.TensorAdd",
"mindspore.Tensor",
"numpy.arange"
] | [((1289, 1354), 'mindspore.context.set_context', 'context.set_context', ([], {'mode': 'context.GRAPH_MODE', 'device_target': '"""CPU"""'}), "(mode=context.GRAPH_MODE, device_target='CPU')\n", (1308, 1354), True, 'import mindspore.context as context\n'), ((946, 959), 'mindspore.ops.operations.TensorAdd', 'P.TensorAdd', ... |
# -*- coding: utf-8 -*-
# @Time : 2019/6/27
# @Author : Godder
# @Github : https://github.com/WangGodder
from .base import CrossModalTrainBase
import numpy as np
import torch
class CrossModalPairwiseTrain(CrossModalTrainBase):
"""
Pairwise: return two random sample, they might be either dissimilarity or ... | [
"torch.Tensor",
"numpy.array"
] | [((2001, 2031), 'torch.Tensor', 'torch.Tensor', (['self.label[item]'], {}), '(self.label[item])\n', (2013, 2031), False, 'import torch\n'), ((2052, 2086), 'torch.Tensor', 'torch.Tensor', (['self.label[ano_item]'], {}), '(self.label[ano_item])\n', (2064, 2086), False, 'import torch\n'), ((2120, 2134), 'numpy.array', 'np... |
"""
author: <NAME>
Notation is (wherever possible) inspired by Curtis, Overton "SQP FOR NONSMOOTH CONSTRAINED OPTIMIZATION"
"""
import numpy as np
import cvxopt as cx
def sample_points(x, eps, N):
"""
sample N points uniformly distributed in eps-ball around x
"""
dim = len(x)
U = np.random.ra... | [
"numpy.abs",
"numpy.maximum",
"numpy.sum",
"numpy.ones",
"numpy.linalg.norm",
"numpy.arange",
"numpy.inner",
"numpy.random.randn",
"numpy.max",
"numpy.repeat",
"cvxopt.matrix",
"numpy.roll",
"numpy.hstack",
"numpy.all",
"numpy.vstack",
"numpy.outer",
"numpy.zeros",
"numpy.array",
... | [((308, 331), 'numpy.random.randn', 'np.random.randn', (['N', 'dim'], {}), '(N, dim)\n', (323, 331), True, 'import numpy as np\n'), ((345, 370), 'numpy.linalg.norm', 'np.linalg.norm', (['U'], {'axis': '(1)'}), '(U, axis=1)\n', (359, 370), True, 'import numpy as np\n'), ((1441, 1468), 'numpy.linalg.norm', 'np.linalg.nor... |
from PIL import Image
import numpy as np
from skimage import transform
from skimage.transform import rotate, AffineTransform,warp
from skimage.util import random_noise
from skimage.filters import gaussian
from scipy import ndimage
import cv2
import random
from skimage import img_as_ubyte
import os
# edit for director... | [
"cv2.GaussianBlur",
"os.mkdir",
"numpy.resize",
"os.path.isdir",
"skimage.util.random_noise",
"numpy.flipud",
"PIL.Image.open",
"PIL.Image.fromarray",
"numpy.fliplr",
"numpy.rot90",
"numpy.array",
"skimage.transform.rotate",
"os.listdir"
] | [((876, 911), 'skimage.transform.rotate', 'rotate', (['im', 'int_angle'], {'resize': '(False)'}), '(im, int_angle, resize=False)\n', (882, 911), False, 'from skimage.transform import rotate, AffineTransform, warp\n'), ((1132, 1148), 'skimage.util.random_noise', 'random_noise', (['im'], {}), '(im)\n', (1144, 1148), Fals... |
import cv2
import numpy as np
import time
cap = cv2.VideoCapture(0)
time.sleep(3)
background = 0
for i in range(30):
ret, background = cap.read()
background = np.flip(background, axis=1)
while(cap.isOpened()):
ret, img = cap.read()
img = np.flip(img, axis=1)
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV... | [
"numpy.flip",
"cv2.bitwise_not",
"cv2.bitwise_and",
"cv2.cvtColor",
"cv2.waitKey",
"numpy.ones",
"time.sleep",
"cv2.VideoCapture",
"cv2.addWeighted",
"numpy.array",
"cv2.imshow",
"cv2.inRange"
] | [((49, 68), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (65, 68), False, 'import cv2\n'), ((69, 82), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (79, 82), False, 'import time\n'), ((166, 193), 'numpy.flip', 'np.flip', (['background'], {'axis': '(1)'}), '(background, axis=1)\n', (173, 193), T... |
import math
import numpy as np
import torch
from torch import nn
from torch.autograd import Variable
import torch.optim as optim
import torch.nn.functional as F
class biDafAttn(nn.Module):
def __init__(self, channel_size):
super(biDafAttn, self).__init__()
"""
This method do biDaf from s2... | [
"torch.nn.Dropout",
"torch.bmm",
"torch.nn.Embedding",
"torch.cat",
"numpy.argsort",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.FloatTensor",
"torch.nn.Linear",
"torch.nn.LSTM",
"torch.nn.GRU",
"torch.nn.Tanh",
"torch.autograd.Variable",
"to... | [((10774, 10803), 'torch.transpose', 'torch.transpose', (['inputs', '(0)', '(1)'], {}), '(inputs, 0, 1)\n', (10789, 10803), False, 'import torch\n'), ((10984, 11013), 'torch.transpose', 'torch.transpose', (['inputs', '(0)', '(1)'], {}), '(inputs, 0, 1)\n', (10999, 11013), False, 'import torch\n'), ((14087, 14156), 'tor... |
import numpy as np
import pandas as pd
from scipy import stats, optimize
import patsy
import prettytable
class Response(object):
def __init__(self, y):
self.y = y
self.Kmin = np.apply_along_axis(max, 1, y)
class Submodel(object):
def __init__(self, name, code, formula, invlink, data):
... | [
"pandas.DataFrame",
"scipy.optimize.minimize",
"patsy.dmatrix",
"numpy.apply_along_axis",
"prettytable.PrettyTable",
"scipy.stats.norm.interval",
"numpy.matmul",
"pandas.concat"
] | [((197, 227), 'numpy.apply_along_axis', 'np.apply_along_axis', (['max', '(1)', 'y'], {}), '(max, 1, y)\n', (216, 227), True, 'import numpy as np\n'), ((599, 637), 'patsy.dmatrix', 'patsy.dmatrix', (['self.formula', 'self.data'], {}), '(self.formula, self.data)\n', (612, 637), False, 'import patsy\n'), ((1107, 1130), 'n... |
import numpy as np
__all__ = ['dj_config', 'pipeline', 'test_data', 'subjects_csv', 'ingest_subjects',
'sessions_csv', 'ingest_sessions', 'testdata_paths', 'kilosort_paramset',
'ephys_recordings', 'clustering_tasks', 'clustering', 'curations']
from . import (dj_config, pipeline, test_data,
... | [
"numpy.array"
] | [((1371, 1594), 'numpy.array', 'np.array', (['[5, 14, 23, 32, 41, 50, 59, 68, 77, 86, 95, 104, 113, 122, 131, 140, 149, \n 158, 167, 176, 185, 194, 203, 212, 221, 230, 239, 248, 257, 266, 275, \n 284, 293, 302, 311, 320, 329, 338, 347, 356, 365, 374, 383]'], {}), '([5, 14, 23, 32, 41, 50, 59, 68, 77, 86, 95, 104,... |
import unittest
import numpy as np
import torch
from autoagent.utils.vision import compute_iou, compute_iou_centered, compute_generalized_iou
class TestYolo(unittest.TestCase):
def test_compute_iou(self):
# Max ious
bboxes1 = np.array([
[0, 0, 20, 20],
[10, 10, 30, 30],
... | [
"numpy.copy",
"autoagent.utils.vision.compute_generalized_iou",
"numpy.array",
"numpy.testing.assert_array_almost_equal",
"torch.from_numpy"
] | [((250, 335), 'numpy.array', 'np.array', (['[[0, 0, 20, 20], [10, 10, 30, 30], [-10, -5, 10, 5]]'], {'dtype': 'np.float32'}), '([[0, 0, 20, 20], [10, 10, 30, 30], [-10, -5, 10, 5]], dtype=np.float32\n )\n', (258, 335), True, 'import numpy as np\n'), ((395, 411), 'numpy.copy', 'np.copy', (['bboxes1'], {}), '(bboxes1)... |
from __future__ import division
from bayes_change import bayes_change
from birth import birth
from bayes_birth_frank import bayes_birth_frank
from bayes_birth_gumbel import bayes_birth_gumbel
from bayes_birth_clay import bayes_birth_clay
from bayes_birth_only_frank import bayes_birth_only_frank
from bayes_birth_only_gu... | [
"bayes_move_gumbel.bayes_move_gumbel",
"bayes_birth_only_clay.bayes_birth_only_clay",
"move_lapl.move_lapl",
"bayes_birth_frank.bayes_birth_frank",
"bayes_kill_clay.bayes_kill_clay",
"bayes_move_clay.bayes_move_clay",
"bayes_kill_frank.bayes_kill_frank",
"kill.kill",
"bayes_birth_only_frank.bayes_bi... | [((907, 950), 'numpy.count_nonzero', 'np.count_nonzero', (['(currentModel == 0)'], {'axis': '(0)'}), '(currentModel == 0, axis=0)\n', (923, 950), True, 'import numpy as np\n'), ((10071, 10134), 'pandas.read_excel', 'read_excel', (['"""../data/artificial_data.xlsx"""'], {'sheet_name': '"""Sheet1"""'}), "('../data/artifi... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 26 11:47:58 2019
@author: dmason
"""
# Import libraries
import os
import copy
import numpy as np
import pandas as pd
# Import machine learning models
from LogReg import LogReg_classification
from LogReg2D import LogReg2D_classification
from KNN im... | [
"pandas.DataFrame",
"utils.data_split_adj",
"os.makedirs",
"utils.seq_classification",
"utils.load_input_data",
"copy.copy",
"utils.data_split",
"numpy.array",
"numpy.linspace",
"os.path.join",
"CNN.CNN_classification"
] | [((992, 1033), 'utils.load_input_data', 'load_input_data', (['ab_neg_files'], {'Ag_class': '(0)'}), '(ab_neg_files, Ag_class=0)\n', (1007, 1033), False, 'from utils import data_split, data_split_adj, seq_classification, load_input_data\n'), ((1250, 1291), 'utils.load_input_data', 'load_input_data', (['ab_pos_files'], {... |
import numpy as np
import pytest
from tensorflow.keras import backend as K
from tensorflow.keras.layers import (Conv2D, Dense, GlobalAveragePooling2D, Input)
from tensorflow.keras.models import Model
from tf_keras_vis.activation_maximization import ActivationMaximization
from tf_keras_vis.utils.callbacks import Optimi... | [
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Dense",
"tf_keras_vis.activation_maximization.ActivationMaximization",
"pytest.fixture",
"tf_keras_vis.utils.regularizers.TotalVariation",
"tensorflow.keras.models.Model",
"tf_keras_vis.utils.losses.CategoricalScore",
"pytest.raises",
"tf_ke... | [((737, 783), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""', 'autouse': '(True)'}), "(scope='function', autouse=True)\n", (751, 783), False, 'import pytest\n'), ((961, 1007), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""', 'autouse': '(True)'}), "(scope='function', autouse=Tru... |
import sys
import numpy as np
def lowpoint(y, x, matrix):
ymax, xmax = matrix.shape
val = matrix[(y, x)]
top = (y - 1, x)
bottom = (y + 1, x)
left = (y, x - 1)
right = (y, x + 1)
if y == 0:
top = None
if y == (ymax - 1):
bottom = None
if x == 0:
left = None
if x == (xmax - 1):
right = None
points... | [
"numpy.array"
] | [((681, 692), 'numpy.array', 'np.array', (['m'], {}), '(m)\n', (689, 692), True, 'import numpy as np\n')] |
'''
This program will plot the final temperature map using the temperatures calculated from sherpa and the binnings from WVT
'''
import os
import numpy as np
import matplotlib as mpl
from astropy.io import fits
from astropy.wcs import WCS
import matplotlib.pyplot as plt
import matplotlib.colorbar as cbar
from matplotli... | [
"matplotlib.pyplot.title",
"matplotlib.cm.get_cmap",
"matplotlib.pyplot.axes",
"astropy.io.fits.PrimaryHDU",
"matplotlib.pyplot.figure",
"astropy.io.fits.HDUList",
"numpy.round",
"numpy.std",
"numpy.max",
"numpy.median",
"matplotlib.colorbar.make_axes",
"numpy.min",
"astropy.io.fits.open",
... | [((1699, 1714), 'astropy.wcs.WCS', 'WCS', (['hdu.header'], {}), '(hdu.header)\n', (1702, 1714), False, 'from astropy.wcs import WCS\n'), ((1792, 1804), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1802, 1804), True, 'import matplotlib.pyplot as plt\n'), ((1844, 1910), 'matplotlib.pyplot.axes', 'plt.axes... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from torch.utils.data._utils.collate import default_collate, _use_shared_memory
import numpy as np
import sys
import os
from os.path import join
from tqdm import tqdm, trange
import json
import math
impo... | [
"random.shuffle",
"random.choices",
"torch.cat",
"torch.full",
"collections.defaultdict",
"data_proc.index_cn.load_sent_from_shard",
"data_proc.index_cn.load_neighbor_cididxs",
"numpy.mean",
"numpy.random.geometric",
"os.path.join",
"utils.common.load_json",
"utils.common.save_json",
"torch.... | [((7288, 7317), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (7311, 7317), False, 'import collections\n'), ((7342, 7371), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (7365, 7371), False, 'import collections\n'), ((8344, 8368), 'copy.copy', 'copy... |
"""
Copyright (c) 2019 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 applicable law or agreed to in wri... | [
"numpy.array"
] | [((1863, 1876), 'numpy.array', 'np.array', (['[1]'], {}), '([1])\n', (1871, 1876), True, 'import numpy as np\n')] |
import gym
from gym import error, spaces, utils
from gym.utils import seeding
import numpy as np
from gym_quoridor import enums, quoridorvars, rendering
from gym_quoridor.quoridorgame import QuoridorGame
class QuoridorEnv(gym.Env):
metadata = {'render.modes': ['terminal','human'] }
quoridorgame = QuoridorGame()
... | [
"gym_quoridor.quoridorgame.QuoridorGame.get_game_ended",
"gym_quoridor.rendering.draw_potential_move",
"gym_quoridor.quoridorgame.QuoridorGame.get_init_board",
"gym_quoridor.rendering.draw_invalid_walls",
"gym_quoridor.quoridorgame.QuoridorGame.get_path_len",
"pyglet.gl.glLineWidth",
"gym_quoridor.quori... | [((304, 318), 'gym_quoridor.quoridorgame.QuoridorGame', 'QuoridorGame', ([], {}), '()\n', (316, 318), False, 'from gym_quoridor.quoridorgame import QuoridorGame\n'), ((669, 702), 'gym_quoridor.quoridorgame.QuoridorGame.get_init_board', 'QuoridorGame.get_init_board', (['size'], {}), '(size)\n', (696, 702), False, 'from ... |
"""AIDA module responsible for the vdf handling.
etienne.behar
"""
import sys
import time
from datetime import timedelta
import matplotlib as mpl
import numpy as np
from matplotlib.dates import date2num
import xarray as xr
from scipy.interpolate import RegularGridInterpolator
import scipy.stats
from scipy.interpolate i... | [
"numpy.abs",
"aidapy.tools.vdf_plot.cart",
"numpy.isnan",
"numpy.arange",
"matplotlib.dates.date2num",
"aidapy.tools.vdf_utils.init_grid",
"numpy.nanmean",
"numpy.zeros_like",
"aidapy.load_data",
"numpy.transpose",
"aidapy.tools.vdf_utils.cart2spher",
"datetime.timedelta",
"numpy.swapaxes",
... | [((574, 609), 'xarray.register_dataset_accessor', 'xr.register_dataset_accessor', (['"""vdf"""'], {}), "('vdf')\n", (602, 609), True, 'import xarray as xr\n'), ((2408, 2452), 'aidapy.tools.vdf_utils.init_grid', 'vdfu.init_grid', (['v_max', 'resolution', 'grid_geom'], {}), '(v_max, resolution, grid_geom)\n', (2422, 2452... |
# Author: <NAME>, 2019
# License: BSD
import numpy as np
def load_label_ranking_data(fn):
f = open(fn)
next(f) # skip first line
X = []
Y = []
for line in f:
arr = line.strip().split(",")
features = np.array(arr[:-1], dtype=float)
X.append(features)
# Labels h... | [
"numpy.array"
] | [((242, 273), 'numpy.array', 'np.array', (['arr[:-1]'], {'dtype': 'float'}), '(arr[:-1], dtype=float)\n', (250, 273), True, 'import numpy as np\n'), ((641, 652), 'numpy.array', 'np.array', (['X'], {}), '(X)\n', (649, 652), True, 'import numpy as np\n'), ((654, 676), 'numpy.array', 'np.array', (['Y'], {'dtype': 'int'}),... |
import os
import time
import torch
import random
import numpy as np
import torch.nn as nn
from args import args
from gnn import Ensemble
from dataset import DataSet, preprocess, DataLoader
from sklearn.model_selection import KFold
from sklearn.metrics import accuracy_score, classification_report
seed = 123
random.see... | [
"numpy.random.seed",
"torch.argmax",
"sklearn.metrics.accuracy_score",
"torch.cat",
"sklearn.metrics.classification_report",
"dataset.DataLoader",
"torch.device",
"torch.no_grad",
"dataset.preprocess",
"torch.load",
"os.path.exists",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"random.seed... | [((310, 327), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (321, 327), False, 'import random\n'), ((328, 348), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (342, 348), True, 'import numpy as np\n'), ((349, 372), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (36... |
# --------------
import pandas as pd
import numpy as np
from scipy import stats
import math
data = pd.read_csv(path)
sample_size = 2000
data_sample = data.sample(n = sample_size, random_state = 0)
sample_mean = data_sample['installment'].mean()
sample_std = data_sample['installment'].std()
z_critical = s... | [
"scipy.stats.norm.ppf",
"math.sqrt",
"pandas.read_csv",
"scipy.stats.chi2.ppf",
"numpy.array",
"scipy.stats.chi2_contingency",
"statsmodels.stats.weightstats.ztest",
"pandas.Series",
"matplotlib.pyplot.subplots"
] | [((105, 122), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (116, 122), True, 'import pandas as pd\n'), ((319, 341), 'scipy.stats.norm.ppf', 'stats.norm.ppf', ([], {'q': '(0.95)'}), '(q=0.95)\n', (333, 341), False, 'from scipy import stats\n'), ((803, 826), 'numpy.array', 'np.array', (['[20, 50, 100]'],... |
import pandas as pd
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
#Generate dummy data
startDate = '2017-11-25'
dateList = pd.date_range(startDate, periods=365).tolist()
df = pd.DataFrame({'Date': dateList,
'Distance': np.random.normal(loc=15, scale=15, size=(365,))
... | [
"seaborn.heatmap",
"matplotlib.pyplot.show",
"pandas.date_range",
"matplotlib.pyplot.subplots",
"numpy.arange",
"numpy.random.normal",
"matplotlib.pyplot.xticks",
"seaborn.set"
] | [((652, 661), 'seaborn.set', 'sns.set', ([], {}), '()\n', (659, 661), True, 'import seaborn as sns\n'), ((672, 701), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(15, 6)'}), '(figsize=(15, 6))\n', (684, 701), True, 'import matplotlib.pyplot as plt\n'), ((704, 841), 'seaborn.heatmap', 'sns.heatmap', (... |
from Fuzzy_clustering.ver_tf2.SKlearn_models import test_grdsearch
from Fuzzy_clustering.ver_tf2.Sklearn_models_skopt import test_skopt
from Fuzzy_clustering.ver_tf2.Sklearn_models_optuna import test_optuna
from Fuzzy_clustering.ver_tf2.Sklearn_models_deap import test_deap
from Fuzzy_clustering.ver_tf2.Feature_selectio... | [
"copy.deepcopy",
"Fuzzy_clustering.ver_tf2.utils_for_forecast.split_continuous",
"Fuzzy_clustering.ver_tf2.Sklearn_models_skopt.test_skopt",
"Fuzzy_clustering.ver_tf2.Sklearn_models_deap.test_deap",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.MinMaxScaler",
"Fuzzy_clustering.ver_t... | [((1278, 1294), 'util_database.write_database', 'write_database', ([], {}), '()\n', (1292, 1294), False, 'from util_database import write_database\n'), ((1544, 1585), 'Fuzzy_clustering.ver_tf2.Forecast_model.forecast_model', 'forecast_model', (['static_data'], {'use_db': '(False)'}), '(static_data, use_db=False)\n', (1... |
from datetime import datetime, timedelta, timezone
import logging
import pickle
import numpy as np
import pandas as pd
from sqlalchemy import and_, func, select
from athenian.api.controllers.miners.github.check_run import _calculate_check_suite_started, \
_merge_status_contexts, _postprocess_check_runs, _split_du... | [
"athenian.api.controllers.miners.github.check_run._merge_status_contexts",
"athenian.api.controllers.miners.github.check_run._calculate_check_suite_started",
"numpy.argsort",
"pickle.load",
"numpy.unique",
"pandas.DataFrame",
"numpy.zeros_like",
"athenian.api.controllers.miners.github.check_run._split... | [((1088, 1137), 'numpy.unique', 'np.unique', (['check_run_node_ids'], {'return_counts': '(True)'}), '(check_run_node_ids, return_counts=True)\n', (1097, 1137), True, 'import numpy as np\n'), ((1179, 1213), 'numpy.flatnonzero', 'np.flatnonzero', (['(node_id_counts > 1)'], {}), '(node_id_counts > 1)\n', (1193, 1213), Tru... |
#! /usr/bin/env python
# GPTune Copyright (c) 2019, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of any
# required approvals from the U.S.Dept. of Energy) and the University of
# California, Berkeley. All rights reserved.
#
# If you have questions a... | [
"ctypes.c_int",
"numpy.empty",
"numpy.ones",
"numpy.clip",
"mpi4py.MPI._addressof",
"sys.stdout.flush",
"numpy.diag",
"os.path.abspath",
"scipy.optimize.minimize",
"mpi4py.MPI.Comm.Get_parent",
"numpy.random.randn",
"ctypes.sizeof",
"numpy.finfo",
"numpy.expm1",
"ctypes.POINTER",
"ctyp... | [((1055, 1097), 'os.path.abspath', 'os.path.abspath', (["(__file__ + '/../../build')"], {}), "(__file__ + '/../../build')\n", (1070, 1097), False, 'import os, ctypes\n'), ((1168, 1223), 'ctypes.cdll.LoadLibrary', 'ctypes.cdll.LoadLibrary', (["(ROOTDIR + '/lib_gptuneclcm.so')"], {}), "(ROOTDIR + '/lib_gptuneclcm.so')\n"... |
from combinations._base_class import ForecastCombinations
import pyswarms as ps
import pyswarms.utils.search.random_search as randomHyper
import util
import numpy as np
import scipy
class PSO(ForecastCombinations):
# increase the iterations and hyper_parameter_iter for better optimization
def __init__(self, t... | [
"pyswarms.single.GlobalBestPSO",
"pyswarms.utils.search.random_search.RandomSearch",
"numpy.array",
"scipy.special.softmax"
] | [((1149, 1418), 'pyswarms.utils.search.random_search.RandomSearch', 'randomHyper.RandomSearch', (['ps.single.GlobalBestPSO'], {'n_particles': 'self.num_particles', 'dimensions': 'self.dimension', 'options': 'self.options', 'bounds': 'self.bounds', 'iters': 'self.iterations', 'objective_func': 'self._objective_func', 'n... |
import numpy as np
from slbo.envs.mujoco.half_cheetah_env import HalfCheetahEnv
from slbo.envs.mujoco.ant_env import AntEnv
from slbo.envs.mujoco.hopper_env import HopperEnv
from slbo.envs.mujoco.walker_env import WalkerEnv
from slbo.envs.mujoco.ant_task_env import AntTaskEnv, AntTaskConfig
from slbo.envs.mujoco.ant3d_... | [
"numpy.random.randint"
] | [((2435, 2461), 'numpy.random.randint', 'np.random.randint', (['(2 ** 60)'], {}), '(2 ** 60)\n', (2452, 2461), True, 'import numpy as np\n')] |
# =============================================================================
# Authors: PAR Government
# Organization: DARPA
#
# Copyright (c) 2016 PAR Government
# All rights reserved.
# ==============================================================================
# Compress_as takes in two JPEG images, and compr... | [
"maskgen.image_wrap.openImageFile",
"os.remove",
"tempfile.mkstemp",
"maskgen.jpeg.utils.get_subsampling",
"numpy.asarray",
"maskgen.jpeg.utils.check_rotate",
"maskgen.exif.getexif",
"maskgen.jpeg.utils.sort_tables",
"maskgen.jpeg.utils.parse_tables",
"os.close",
"maskgen.exif.runexif",
"loggi... | [((2025, 2047), 'maskgen.jpeg.utils.get_subsampling', 'get_subsampling', (['donor'], {}), '(donor)\n', (2040, 2047), False, 'from maskgen.jpeg.utils import get_subsampling, parse_tables, sort_tables, check_rotate\n'), ((2341, 2409), 'maskgen.exif.runexif', 'maskgen.exif.runexif', (["['-overwrite_original', '-q', '-all=... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pragma pylint: disable=unused-argument, no-self-use
#
# (c) Copyright IBM Corp. 2010, 2020. All Rights Reserved.
#
"""
NLPWord2Vec
-----------
NLP model using gensim word2vec
This a super class that encapsulates the common logic of building a NLP model usi... | [
"gensim.models.phrases.Phraser",
"numpy.zeros",
"gensim.models.KeyedVectors.load_word2vec_format",
"fn_machine_learning_nlp.lib.nlp.nlp_settings.NLPSettings.get_instance",
"logging.getLogger",
"multiprocessing.cpu_count"
] | [((2942, 2968), 'fn_machine_learning_nlp.lib.nlp.nlp_settings.NLPSettings.get_instance', 'NLPSettings.get_instance', ([], {}), '()\n', (2966, 2968), False, 'from fn_machine_learning_nlp.lib.nlp.nlp_settings import NLPSettings\n'), ((3289, 3326), 'gensim.models.phrases.Phraser', 'gensim.models.phrases.Phraser', (['bigra... |
import numpy as np
import torch
from envs import ode_env
import disturb_models as dm
from constants import *
'''
Adapted from:
<NAME>, <NAME>, <NAME>. Frequency robust control in stand-alone
microgrids with PV sources : design and sensitivity analysis. Symposium de Génie Electrique, Jun
2016, Grenoble, France. ffhal-... | [
"numpy.random.seed",
"numpy.random.randn",
"disturb_models.NLDIDisturbModel",
"torch.manual_seed",
"numpy.random.rand",
"torch.zeros",
"torch.tensor"
] | [((2336, 2500), 'torch.tensor', 'torch.tensor', (['((omega_b * alpha_ce / C_dc, -omega_b * beta_de / C_dc), (0, 0), ((v_sce - \n 2 * R_sc * i_se) / (2 * H), 0))'], {'dtype': 'TORCH_DTYPE', 'device': 'device'}), '(((omega_b * alpha_ce / C_dc, -omega_b * beta_de / C_dc), (0, 0\n ), ((v_sce - 2 * R_sc * i_se) / (2 *... |
from sklearn.pipeline import Pipeline
from sklearn.base import BaseEstimator, TransformerMixin
import numpy as np
def str_to_ord(string,n=3):
new_str_arr = []
for ch in string:
addition = str(ord(ch))
if len(addition) < n:
for i in range(n-len(addition)):
addition = ... | [
"pdb.set_trace",
"numpy.reshape"
] | [((1784, 1808), 'numpy.reshape', 'np.reshape', (['res', '(-1, 1)'], {}), '(res, (-1, 1))\n', (1794, 1808), True, 'import numpy as np\n'), ((673, 688), 'pdb.set_trace', 'pdb.set_trace', ([], {}), '()\n', (686, 688), False, 'import pdb\n')] |
import numpy as np
from scipy.spatial.transform import Rotation as R
import bezier
import json
demo = {
"rows": 8,
"sides": 5,
"bez_nodes": [
[0.30, 1.00, 0.35],
[0.00, 1.00, 1.25],
[0.00, 0.00, 0.00] # needs 0s to be 3D :)
],
"weights": [0, 0.1, 0.2, 1.0],
"spiral": 0
}
clas... | [
"scipy.spatial.transform.Rotation.from_euler",
"numpy.zeros",
"numpy.linalg.norm",
"numpy.array",
"numpy.linspace",
"numpy.concatenate"
] | [((519, 538), 'numpy.array', 'np.array', (['bez_nodes'], {}), '(bez_nodes)\n', (527, 538), True, 'import numpy as np\n'), ((653, 672), 'numpy.array', 'np.array', (['[weights]'], {}), '([weights])\n', (661, 672), True, 'import numpy as np\n'), ((949, 981), 'numpy.linspace', 'np.linspace', (['(0.0)', '(1.0)', 'self.rows'... |
# TODO need to update this file to remove duplicates that have been refactored...
import bisect
import re
import sys
from pathlib import Path
from typing import Union
import io
import numpy as np
import pandas as pd
import tifffile as tf
import os
import matplotlib.pyplot as plt
import csv
import math
import copy
f... | [
"csv.reader",
"matplotlib.pyplot.suptitle",
"numpy.empty",
"tifffile.imwrite",
"os.walk",
"numpy.isnan",
"numpy.shape",
"packerlabimaging.utils.io.loadmat",
"numpy.argsort",
"numpy.mean",
"numpy.arange",
"statsmodels.stats.ttest_ind",
"matplotlib.pyplot.figure",
"sys.getsizeof",
"numpy.r... | [((1783, 1809), 'os.path.dirname', 'os.path.dirname', (['file_path'], {}), '(file_path)\n', (1798, 1809), False, 'import os\n'), ((3543, 3557), 'numpy.cumsum', 'np.cumsum', (['arr'], {}), '(arr)\n', (3552, 3557), True, 'import numpy as np\n'), ((5355, 5409), 'numpy.arange', 'np.arange', (['(x0 - radius - 1)', '(x0 + ra... |
import pickle
import numpy as np
# # with open('/home/yilin.shen/mi/3DnnUNet/preprocessed_data/Task101_COVID_19_20/nnUNetPlansv2.1_plans_3D.pkl', 'rb') as f:
# with open('/home/yilin.shen/mi/3DnnUNet/preprocessed_data/Task101_COVID_19_20/splits_final.pkl', 'rb') as f:
# data = pickle.load(f)
#
# print(data)
l... | [
"numpy.load"
] | [((335, 547), 'numpy.load', 'np.load', (['"""/home/yilin.shen/mi/3DnnUNet/checkpoints/nnUNet_trained_models/nnUNet/3d_lowres/Task101_COVID_19_20/nnUNetTrainerV2__nnUNetPlansv2.1/pred_next_stage/volume-covid19-A-0698_segFromPrevStage.npz"""'], {}), "(\n '/home/yilin.shen/mi/3DnnUNet/checkpoints/nnUNet_trained_models/... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import tensorflow as tf
import numpy
import pickle
import string
import os
import copy
import LM
import dataset as Dataset
from util import write_log
from util import reverse_seq
from util import target_seq
from util import original_seq_prob
from util import find_k_larg... | [
"numpy.sum",
"tensorflow.trainable_variables",
"tensorflow.ConfigProto",
"util.random_pick_idx_with_unnormalized_prob",
"numpy.mean",
"util.prob_len_modify",
"util.find_k_largest",
"LM.LanguageModel",
"util.original_seq_prob",
"util.write_log",
"dataset.Dictionary",
"tensorflow.variable_scope"... | [((20617, 20692), 'dataset.Dictionary', 'Dataset.Dictionary', (['"""./one_billion_word/vocab_1M_processed.pkl"""', 'vocab_size'], {}), "('./one_billion_word/vocab_1M_processed.pkl', vocab_size)\n", (20635, 20692), True, 'import dataset as Dataset\n'), ((20900, 20933), 'tensorflow.global_variables_initializer', 'tf.glob... |
"""
This module has useful functions like smoothing, window-deconvolve, derivative etc.
Transfer functions associated with ParticleMesh objects are named pmXyz where Xyz
is the logical name.
"""
import numpy
import math
from scipy.interpolate import InterpolatedUnivariateSpline as interpolate
from scipy.integrate ... | [
"numpy.ones",
"numpy.histogram",
"numpy.sinc",
"numpy.arange",
"numpy.exp",
"numpy.sin",
"numpy.zeros_like",
"scipy.interpolate.InterpolatedUnivariateSpline",
"numpy.fft.fftfreq",
"numpy.loadtxt",
"numpy.bincount",
"numpy.log10",
"scipy.integrate.simps",
"numpy.roll",
"numpy.cos",
"num... | [((1343, 1376), 'numpy.roll', 'numpy.roll', (['pm.real', '(-1)'], {'axis': 'dir'}), '(pm.real, -1, axis=dir)\n', (1353, 1376), False, 'import numpy\n'), ((1391, 1423), 'numpy.roll', 'numpy.roll', (['pm.real', '(1)'], {'axis': 'dir'}), '(pm.real, 1, axis=dir)\n', (1401, 1423), False, 'import numpy\n'), ((1600, 1633), 'n... |
import numpy as np
import pickle
from qanta.extractors.abstract import AbstractFeatureExtractor
from qanta.util.constants import SENTENCE_STATS
from qanta.util.environment import QB_QUESTION_DB
from qanta.util.io import safe_open
from qanta.datasets.quiz_bowl import QuizBowlDataset, QuestionDatabase
class StatsExtra... | [
"pickle.dump",
"qanta.datasets.quiz_bowl.QuizBowlDataset",
"numpy.std",
"qanta.util.io.safe_open",
"numpy.mean",
"pickle.load",
"qanta.datasets.quiz_bowl.QuestionDatabase"
] | [((2135, 2186), 'qanta.datasets.quiz_bowl.QuizBowlDataset', 'QuizBowlDataset', (['(5)'], {'qb_question_db': 'question_db_path'}), '(5, qb_question_db=question_db_path)\n', (2150, 2186), False, 'from qanta.datasets.quiz_bowl import QuizBowlDataset, QuestionDatabase\n'), ((2378, 2403), 'numpy.mean', 'np.mean', (['questio... |
import argparse
import os
import shutil
import threading
import numpy as np
import torch
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.data as data
import torch.utils.tensorboard as tensorboard
import yaml
import mrf.data.dataset as ds
import mrf.data.definition as defs
import mrf.eva... | [
"mrf.data.dataset.NumpyMRFDataset",
"yaml.load",
"mrf.loop.callback.TensorBoardLog",
"argparse.ArgumentParser",
"mrf.model.invnet.get_invnet",
"torch.cat",
"torch.randn",
"numpy.mean",
"mrf.loop.loops.TrainLoop",
"os.path.join",
"torch.utils.data.DataLoader",
"os.path.dirname",
"mrf.loop.cal... | [((1643, 1677), 'torch.utils.tensorboard.SummaryWriter', 'tensorboard.SummaryWriter', (['run_dir'], {}), '(run_dir)\n', (1668, 1677), True, 'import torch.utils.tensorboard as tensorboard\n'), ((1761, 1796), 'os.path.join', 'os.path.join', (['run_dir', '"""validation"""'], {}), "(run_dir, 'validation')\n", (1773, 1796),... |
import numpy as np
from ... import draw
from .internal import PatchUser
from matplotlib.patches import Circle, Wedge
class Disks(draw.Disks, PatchUser):
__doc__ = draw.Disks.__doc__
def _render_patches(self, axes, aa_pixel_size=0, **kwargs):
result = []
outline = self.outline
if outli... | [
"matplotlib.patches.Wedge",
"numpy.zeros_like",
"matplotlib.patches.Circle"
] | [((532, 558), 'numpy.zeros_like', 'np.zeros_like', (['self.colors'], {}), '(self.colors)\n', (545, 558), True, 'import numpy as np\n'), ((890, 914), 'matplotlib.patches.Circle', 'Circle', (['position', 'radius'], {}), '(position, radius)\n', (896, 914), False, 'from matplotlib.patches import Circle, Wedge\n'), ((455, 5... |
import json
import numpy as np
import pandas as pd
from pathlib import Path
from typing import Union
from nltk import word_tokenize
from tqdm import tqdm
import plotly.offline as py
import plotly.graph_objects as go
from .dataset import Dataset
from .encoder import Encoder
from .metrics import levenshtein, levenshtei... | [
"pandas.DataFrame",
"json.dump",
"tqdm.tqdm",
"plotly.graph_objects.Histogram",
"numpy.median",
"numpy.isnan",
"numpy.array",
"nltk.word_tokenize"
] | [((1655, 1675), 'nltk.word_tokenize', 'word_tokenize', (['sent1'], {}), '(sent1)\n', (1668, 1675), False, 'from nltk import word_tokenize\n'), ((1692, 1712), 'nltk.word_tokenize', 'word_tokenize', (['sent2'], {}), '(sent2)\n', (1705, 1712), False, 'from nltk import word_tokenize\n'), ((2839, 2886), 'numpy.array', 'np.a... |
import numpy as np
from COTR.transformations import transformations
from COTR.utils import constants
class Rotation():
def __init__(self, quat):
"""
quaternion format (w, x, y, z)
"""
assert quat.dtype == np.float32
self.quaternion = quat
def __str__(self):
st... | [
"numpy.eye",
"COTR.transformations.transformations.quaternion_from_matrix",
"COTR.transformations.transformations.quaternion_matrix",
"numpy.linalg.norm",
"COTR.transformations.transformations.translation_from_matrix",
"COTR.transformations.transformations.translation_matrix"
] | [((1055, 1098), 'COTR.transformations.transformations.quaternion_from_matrix', 'transformations.quaternion_from_matrix', (['mat'], {}), '(mat)\n', (1093, 1098), False, 'from COTR.transformations import transformations\n'), ((2778, 2822), 'COTR.transformations.transformations.translation_from_matrix', 'transformations.t... |
"""
Implementation of the adversarial attack detection method from the paper:
<NAME>, et al. "Characterizing adversarial subspaces using local intrinsic dimensionality.",
International conference on learning representations, 2018.
https://arxiv.org/pdf/1801.02613.pdf
Some of this code is borrowed from: https://githu... | [
"pickle.dump",
"numpy.random.seed",
"numpy.logspace",
"sklearn.preprocessing.MinMaxScaler",
"numpy.ones",
"pickle.load",
"helpers.utils.get_num_jobs",
"subprocess.check_call",
"numpy.unique",
"helpers.lid_estimators.lid_mle_amsaleg",
"helpers.dimension_reduction_methods.transform_data_from_model... | [((2053, 2111), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'stream': 'sys.stdout'}), '(level=logging.INFO, stream=sys.stdout)\n', (2072, 2111), False, 'import logging\n'), ((2121, 2148), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2138, 2148), False, ... |
import os
import sys
import numpy as np
import traci
from sumolib import checkBinary
from internal.MyConnector import TrafficEnvironmentConnector
class SumoConnector(TrafficEnvironmentConnector):
def __init__(self, name, conf):
super(SumoConnector, self).__init__(name, conf)
# 1. check ennvironm... | [
"traci.trafficlight.getPhase",
"traci.lane.getLastStepMeanSpeed",
"traci.start",
"os.path.join",
"traci.lane.getLastStepVehicleNumber",
"numpy.round",
"sys.path.append",
"traci.trafficlight.setPhase",
"traci.trafficlight.getControlledLanes",
"traci.trafficlight.getIDList",
"traci.lane.getLength"... | [((1238, 1262), 'sumolib.checkBinary', 'checkBinary', (['binary_name'], {}), '(binary_name)\n', (1249, 1262), False, 'from sumolib import checkBinary\n'), ((1664, 1692), 'traci.start', 'traci.start', (['cur_start_param'], {}), '(cur_start_param)\n', (1675, 1692), False, 'import traci\n'), ((1730, 1743), 'traci.close', ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.