code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
#!/usr/bin/env python
from distutils.core import setup
setup(name='simple21',
version='1.0',
description='Simple21Tree: A tree of #Hashtags to increase obviousness',
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/guettli/simple21tree/',
packages=['simple21'],
... | [
"distutils.core.setup"
] | [((57, 391), 'distutils.core.setup', 'setup', ([], {'name': '"""simple21"""', 'version': '"""1.0"""', 'description': '"""Simple21Tree: A tree of #Hashtags to increase obviousness"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/guettli/simple21tree/"""', 'packages': "['simpl... |
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql as psql
from sqlalchemy import func
from pathlib import Path
import fitsio # for catalogs, faster
import numpy as np
from .file import File, UnmappedFileError
from .core import Base, DBSession
from .spatial import HasPoly, SpatiallyIndexed
__all__... | [
"astropy.io.fits.ImageHDU",
"sqlalchemy.func.q3c_poly_query",
"fitsio.FITS",
"astropy.io.fits.writeto",
"numpy.asarray",
"astropy.io.fits.PrimaryHDU",
"pathlib.Path",
"astroquery.gaia.Gaia.launch_job_async",
"astropy.wcs.utils.proj_plane_pixel_scales",
"astropy.io.fits.open",
"sqlalchemy.Column"... | [((890, 911), 'sqlalchemy.Column', 'sa.Column', (['psql.JSONB'], {}), '(psql.JSONB)\n', (899, 911), True, 'import sqlalchemy as sa\n'), ((934, 955), 'sqlalchemy.Column', 'sa.Column', (['psql.JSONB'], {}), '(psql.JSONB)\n', (943, 955), True, 'import sqlalchemy as sa\n'), ((1388, 1395), 'pathlib.Path', 'Path', (['f'], {}... |
import insightconnect_plugin_runtime
from .schema import RunAnalysisInput, RunAnalysisOutput, Input, Output, Component
# Custom imports below
import base64
from insightconnect_plugin_runtime.exceptions import PluginException
class RunAnalysis(insightconnect_plugin_runtime.Action):
def __init__(self):
sup... | [
"insightconnect_plugin_runtime.exceptions.PluginException"
] | [((767, 882), 'insightconnect_plugin_runtime.exceptions.PluginException', 'PluginException', ([], {'cause': '"""Missing file content."""', 'assistance': '"""Complete the file input with base64 file content."""'}), "(cause='Missing file content.', assistance=\n 'Complete the file input with base64 file content.')\n",... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | [
"pipeline.component_framework.models.ComponentModel.objects.all",
"pipeline.utils.register.autodiscover_collections",
"logging.getLogger",
"pipeline.component_framework.library.ComponentLibrary.codes",
"pipeline.component_framework.library.ComponentLibrary.versions"
] | [((979, 1004), 'logging.getLogger', 'logging.getLogger', (['"""root"""'], {}), "('root')\n", (996, 1004), False, 'import logging\n'), ((1738, 1768), 'pipeline.utils.register.autodiscover_collections', 'autodiscover_collections', (['path'], {}), '(path)\n', (1762, 1768), False, 'from pipeline.utils.register import autod... |
#!/usr/bin/env python
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generates a JSON typemap from its command-line arguments and dependencies.
Each typemap should be specified in an command-line argum... | [
"json.dump",
"json.load",
"argparse.ArgumentParser",
"os.path.exists",
"re.compile"
] | [((2000, 2242), 're.compile', 're.compile', (['"""^([^=]+) # mojom type\n =\n ([^[]+) # native type\n (?:\\\\[([^]]+)\\\\])?$ # optional attribute in square brackets\n """', 're.X'], {}), '(\n """^([^=]+) # mo... |
import numpy as np
import numba
@numba.njit(cache=True)
def maxprominencedip(events, start, end, top, n):
"""
Find the negative peaks with the maximum prominence in arrays.
For computing the prominence, maxima occuring on the border of the array
are ignored, unless both the left and right maxima o... | [
"numpy.full",
"numpy.random.uniform",
"numba.njit",
"numpy.array",
"numpy.exp",
"numpy.linspace",
"matplotlib.pyplot.subplots"
] | [((34, 56), 'numba.njit', 'numba.njit', ([], {'cache': '(True)'}), '(cache=True)\n', (44, 56), False, 'import numba\n'), ((1262, 1300), 'numpy.full', 'np.full', (['shape', '(-2 ** 20)', 'events.dtype'], {}), '(shape, -2 ** 20, events.dtype)\n', (1269, 1300), True, 'import numpy as np\n'), ((1316, 1334), 'numpy.full', '... |
import math
import time
import torch
import os
import numpy as np
import torch.nn.functional as F
import matplotlib
matplotlib.use('Agg')
import sys
sys.path.append("..")
import matplotlib.pyplot as plt
# from detectors.evaluation.evaluate import matlab_eval, python_eval
from detectors.evaluation.pyeval.calAOS import e... | [
"numpy.ones",
"torch.cat",
"torch.cos",
"torch.arange",
"torch.no_grad",
"sys.path.append",
"cv2.line",
"torch.nn.MSELoss",
"os.path.abspath",
"cv2.imwrite",
"numpy.savetxt",
"numpy.max",
"numpy.loadtxt",
"math.cos",
"torch.zeros",
"torch.atan2",
"detectors.evaluation.pyeval.calAOS.e... | [((116, 137), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (130, 137), False, 'import matplotlib\n'), ((149, 170), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (164, 170), False, 'import sys\n'), ((800, 833), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""i... |
from foundations_rest_api.utils.api_resource import api_resource
from foundations_core_rest_api_components.v1.controllers.job_logs_controller import JobLogsController
JobLogsController = api_resource('/api/v2beta/projects/<string:project_name>/job_listing/<string:job_id>/logs')(JobLogsController) | [
"foundations_rest_api.utils.api_resource.api_resource"
] | [((190, 291), 'foundations_rest_api.utils.api_resource.api_resource', 'api_resource', (['"""/api/v2beta/projects/<string:project_name>/job_listing/<string:job_id>/logs"""'], {}), "(\n '/api/v2beta/projects/<string:project_name>/job_listing/<string:job_id>/logs'\n )\n", (202, 291), False, 'from foundations_rest_ap... |
# module for data collecting and preprocessing;
#%%
import os
import numpy as np
import math
# turn global word frequency into IDF index
def computeIDF(wordFreqInSet, count):
# idf_i = log(|D|/(1+|D_i|))
for item in wordFreqInSet.items():
wordFreqInSet[item[0]] = math.log2(count / (1+item[1]))
retu... | [
"math.log2"
] | [((281, 313), 'math.log2', 'math.log2', (['(count / (1 + item[1]))'], {}), '(count / (1 + item[1]))\n', (290, 313), False, 'import math\n')] |
import os
import time
import shutil
import mplfinance as mpf
import pandas as pd
from tqdm import tqdm
def get_kchart(src):
src = src[:-4]
df = pd.read_csv(f'./stock_data/{src}.csv')
data = df.drop(columns='code')
data.index = pd.DatetimeIndex(data['date'])
save = dict(fname=f'./static/k_chart/{s... | [
"os.mkdir",
"tqdm.tqdm",
"os.makedirs",
"pandas.read_csv",
"os.path.exists",
"pandas.DatetimeIndex",
"shutil.rmtree",
"os.listdir"
] | [((154, 192), 'pandas.read_csv', 'pd.read_csv', (['f"""./stock_data/{src}.csv"""'], {}), "(f'./stock_data/{src}.csv')\n", (165, 192), True, 'import pandas as pd\n'), ((245, 275), 'pandas.DatetimeIndex', 'pd.DatetimeIndex', (["data['date']"], {}), "(data['date'])\n", (261, 275), True, 'import pandas as pd\n'), ((726, 74... |
import os
from functools import partial
from generate_cmake.log import Log
def _reduce_srcs(sources, base_directory, prejoin="${PROJECT_SOURCE_DIR}"):
return map(lambda o: os.path.join(prejoin, o.replace(base_directory + '/', "")), sources)
def create_lib(build_item, base_directory=""):
bloated_srcs = map(... | [
"functools.partial",
"os.makedirs",
"os.path.exists",
"graph.dependency_sort",
"generate_cmake.log.Log.info",
"generate_cmake.log.Log.success",
"os.path.join",
"os.listdir"
] | [((1697, 1732), 'os.path.join', 'os.path.join', (['base_directory', '"""tmp"""'], {}), "(base_directory, 'tmp')\n", (1709, 1732), False, 'import os\n'), ((1826, 1870), 'os.path.join', 'os.path.join', (['write_folder', '"""CMakeLists.txt"""'], {}), "(write_folder, 'CMakeLists.txt')\n", (1838, 1870), False, 'import os\n'... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import ast
import json
import locale
import logging
import re
from operator import itemgetter
from odoo import api, fields, models, tools, _
from odoo.exceptions import UserError, ValidationError
_logger = logging.getL... | [
"odoo.tools.ormcache",
"odoo._",
"odoo.fields.Selection",
"odoo.tools.config.get",
"json.loads",
"odoo.api.depends",
"odoo.fields.Char",
"odoo.fields.Boolean",
"odoo.tools.get_locales",
"odoo.tools.resetlocale",
"locale.nl_langinfo",
"odoo.tools.DATETIME_FORMATS_MAP.items",
"odoo.exceptions.... | [((308, 335), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (325, 335), False, 'import logging\n'), ((15319, 15353), 're.compile', 're.compile', (['"""([^0-9]*)([^ ]*)(.*)"""'], {}), "('([^0-9]*)([^ ]*)(.*)')\n", (15329, 15353), False, 'import re\n'), ((700, 726), 'odoo.fields.Char', 'fi... |
"""This component provides sensors for UniFi Protect."""
from __future__ import annotations
from dataclasses import dataclass
from datetime import datetime, timedelta
import logging
from typing import Any, Callable, Sequence
from urllib.parse import urlencode
from homeassistant.components.binary_sensor import DEVICE_... | [
"urllib.parse.urlencode",
"logging.getLogger"
] | [((1480, 1507), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1497, 1507), False, 'import logging\n'), ((16824, 16897), 'urllib.parse.urlencode', 'urlencode', (["{'entity_id': self.entity_id, 'token': self.access_tokens[-1]}"], {}), "({'entity_id': self.entity_id, 'token': self.access_t... |
import re
import subprocess
import sys
import time
from argparse import ArgumentParser
from colorama import Fore, init
init()
OS = 'linux'
if sys.platform.lower() != OS:
print(Fore.RED + f'[-] The operating system must be {OS}.')
time.sleep(3)
exit()
def change_mac():
def check_arguments():
... | [
"colorama.init",
"subprocess.Popen",
"argparse.ArgumentParser",
"subprocess.check_output",
"time.sleep",
"sys.platform.lower",
"re.search"
] | [((121, 127), 'colorama.init', 'init', ([], {}), '()\n', (125, 127), False, 'from colorama import Fore, init\n'), ((146, 166), 'sys.platform.lower', 'sys.platform.lower', ([], {}), '()\n', (164, 166), False, 'import sys\n'), ((242, 255), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (252, 255), False, 'import tim... |
import os
from pathlib import Path
class Paths:
"""Manages and configures the paths used by WaveRNN, Tacotron, and the data."""
def __init__(self, data_path, voc_id):
self.base = Path(__file__).parent.parent.expanduser().resolve()
# Data Paths
self.data = Path(data_path).expanduser().... | [
"pathlib.Path",
"os.makedirs"
] | [((988, 1025), 'os.makedirs', 'os.makedirs', (['self.data'], {'exist_ok': '(True)'}), '(self.data, exist_ok=True)\n', (999, 1025), False, 'import os\n'), ((1034, 1072), 'os.makedirs', 'os.makedirs', (['self.quant'], {'exist_ok': '(True)'}), '(self.quant, exist_ok=True)\n', (1045, 1072), False, 'import os\n'), ((1081, 1... |
#!/usr/bin/env python3
"""
Benchmark response time on a domain
Usage:
response.py <domain> [--times=<count>]
response.py -h | --help | -v | --version
Options:
-t --times=<count> Hits to average. [default:10]
-h --help Show this screen.
-v --version Show version.
Dependencies:
pi... | [
"urllib.parse.ParseResult",
"requests.get",
"urllib.parse.urlparse",
"docopt.docopt"
] | [((592, 615), 'urllib.parse.urlparse', 'urlparse', (['url', 'protocol'], {}), '(url, protocol)\n', (600, 615), False, 'from urllib.parse import urlparse, ParseResult\n'), ((765, 808), 'urllib.parse.ParseResult', 'ParseResult', (['protocol', 'netloc', 'path', '*p[3:]'], {}), '(protocol, netloc, path, *p[3:])\n', (776, 8... |
import plyvel
from logzero import logger
from neo.EventHub import events
from neo.SmartContract.SmartContractEvent import SmartContractEvent, NotifyEvent, NotifyType
from neo.Core.State.ContractState import ContractState
from neo.Settings import settings
from neo.Core.Blockchain import Blockchain
from neo.Core.Helper i... | [
"neo.SmartContract.SmartContractEvent.SmartContractEvent.FromByteArray",
"neo.EventHub.events.on",
"plyvel.DB",
"logzero.logger.info",
"neo.Core.Blockchain.Blockchain.Default",
"logzero.logger.error",
"neo.Core.Helper.Helper.AddrStrToScriptHash",
"neocore.UInt160.UInt160.ParseString"
] | [((2388, 2434), 'neo.EventHub.events.on', 'events.on', (['SmartContractEvent.CONTRACT_CREATED'], {}), '(SmartContractEvent.CONTRACT_CREATED)\n', (2397, 2434), False, 'from neo.EventHub import events\n'), ((2444, 2491), 'neo.EventHub.events.on', 'events.on', (['SmartContractEvent.CONTRACT_MIGRATED'], {}), '(SmartContrac... |
#
# Copyright 2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
#... | [
"wx.Point",
"math.sqrt",
"OpenGL.GL.glBegin",
"OpenGL.GL.glEnable",
"gltext.Text",
"common.sci_format",
"math.ceil",
"math.floor",
"OpenGL.GL.glColor3f",
"OpenGL.GL.glEnableClientState",
"OpenGL.GL.glVertex2f",
"OpenGL.GL.glEnd",
"OpenGL.GL.glBlendFunc",
"OpenGL.GL.glVertexPointerf",
"co... | [((1508, 1543), 'plotter_base.plotter_base.__init__', 'plotter_base.__init__', (['self', 'parent'], {}), '(self, parent)\n', (1529, 1543), False, 'from plotter_base import plotter_base\n'), ((2201, 2232), 'common.point_label_thread', 'common.point_label_thread', (['self'], {}), '(self)\n', (2226, 2232), False, 'import ... |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
"""(A partial) implementati... | [
"pickle.dump",
"random.randint",
"random.shuffle",
"torch.load",
"os.path.isfile",
"torch.cuda.is_available",
"torch.cuda.set_device",
"parlai.core.dict.DictionaryAgent.add_cmdline_args"
] | [((1598, 1641), 'parlai.core.dict.DictionaryAgent.add_cmdline_args', 'DictionaryAgent.add_cmdline_args', (['argparser'], {}), '(argparser)\n', (1630, 1641), False, 'from parlai.core.dict import DictionaryAgent\n'), ((5537, 5597), 'torch.load', 'torch.load', (['fname'], {'map_location': '(lambda storage, loc: storage)'}... |
from builtins import str
import json
import functools
from simple_salesforce import SalesforceMalformedRequest
def memoize(obj):
cache = obj.cache = {}
@functools.wraps(obj)
def memoizer(*args, **kwargs):
key = str(args) + str(kwargs)
if key not in cache:
cache[key] = obj(*ar... | [
"builtins.str",
"functools.wraps",
"json.dumps"
] | [((165, 185), 'functools.wraps', 'functools.wraps', (['obj'], {}), '(obj)\n', (180, 185), False, 'import functools\n'), ((235, 244), 'builtins.str', 'str', (['args'], {}), '(args)\n', (238, 244), False, 'from builtins import str\n'), ((247, 258), 'builtins.str', 'str', (['kwargs'], {}), '(kwargs)\n', (250, 258), False,... |
import torch.nn as nn
class VRDBCELoss(nn.Module):
def __init__(self):
super(VRDBCELoss, self).__init__()
self.loss = nn.BCEWithLogitsLoss()
def forward(self, net_output, target):
y_true = target['target_oh']
cost = self.loss(net_output['rel_scores'], y_true)
out = {}
... | [
"torch.nn.BCEWithLogitsLoss"
] | [((140, 162), 'torch.nn.BCEWithLogitsLoss', 'nn.BCEWithLogitsLoss', ([], {}), '()\n', (160, 162), True, 'import torch.nn as nn\n')] |
import functools
import igraph as ig
import numpy as np
import torch
from . import tflite as tfl
from .base import ExtendedOperator
from .graph import CommonGraph
from tinynn.util.util import get_logger
log = get_logger(__name__)
class HybridQuantizer(object):
graph: CommonGraph
def __init__(self, graph,... | [
"torch.finfo",
"torch.zeros_like",
"numpy.frombuffer",
"torch.amin",
"torch.quantize_per_channel",
"torch.max",
"torch.min",
"torch.amax",
"torch.quantize_per_tensor",
"tinynn.util.util.get_logger"
] | [((213, 233), 'tinynn.util.util.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (223, 233), False, 'from tinynn.util.util import get_logger\n'), ((4055, 4091), 'torch.max', 'torch.max', (['(-min_val_neg)', 'max_val_pos'], {}), '(-min_val_neg, max_val_pos)\n', (4064, 4091), False, 'import torch\n'), ((416... |
from PyQt5 import uic, QtCore
from PyQt5.QtWidgets import *
from lib.dojo_requests import SUPPORTED_BROWSERS
from lib.actions import save_grades, save_belts, save_usage
from setting import config, save_settings, SAVED_BELTS_KEY, SAVED_GRADES_KEY, SAVED_USAGES_KEY
class MainWindow(QMainWindow):
def __init__(self,... | [
"lib.actions.save_belts",
"setting.save_settings",
"PyQt5.uic.loadUi",
"lib.dojo_requests.SUPPORTED_BROWSERS.index",
"lib.actions.save_grades",
"lib.actions.save_usage"
] | [((638, 664), 'PyQt5.uic.loadUi', 'uic.loadUi', (['"""gui.ui"""', 'self'], {}), "('gui.ui', self)\n", (648, 664), False, 'from PyQt5 import uic, QtCore\n'), ((1407, 1450), 'lib.dojo_requests.SUPPORTED_BROWSERS.index', 'SUPPORTED_BROWSERS.index', (["config['browser']"], {}), "(config['browser'])\n", (1431, 1450), False,... |
#!/usr/bin/env python3
#
# Copyright (C) 2022 Intel Corporation.
#
# SPDX-License-Identifier: BSD-3-Clause
#
import os
import argparse
import elementpath
from scenario_transformer import ScenarioTransformer
from pipeline import PipelineObject, PipelineStage, PipelineEngine
from schema_slicer import SlicingSchemaByVM... | [
"elementpath.select",
"pipeline.PipelineObject",
"argparse.ArgumentParser",
"pipeline.PipelineEngine",
"os.path.dirname",
"xml_loader.XMLLoadStage",
"schema_slicer.SlicingSchemaByVMTypeStage",
"lxml_loader.LXMLLoadStage",
"os.path.join"
] | [((2865, 2913), 'pipeline.PipelineEngine', 'PipelineEngine', (["['schema_path', 'scenario_path']"], {}), "(['schema_path', 'scenario_path'])\n", (2879, 2913), False, 'from pipeline import PipelineObject, PipelineStage, PipelineEngine\n'), ((3102, 3170), 'pipeline.PipelineObject', 'PipelineObject', ([], {'schema_path': ... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""Pandas ... | [
"IPython.display.display",
"pandas.api.extensions.register_dataframe_accessor",
"IPython.get_ipython",
"warnings.warn",
"IPython.display.HTML"
] | [((592, 649), 'pandas.api.extensions.register_dataframe_accessor', 'pd.api.extensions.register_dataframe_accessor', (['"""mp_pivot"""'], {}), "('mp_pivot')\n", (637, 649), True, 'import pandas as pd\n'), ((858, 871), 'IPython.get_ipython', 'get_ipython', ([], {}), '()\n', (869, 871), False, 'from IPython import get_ipy... |
import data
import numpy as np
import matplotlib.pyplot as plt
from skimage import morphology
import cv2
real_img = np.load('real_img.npy')
vessel_mask_pred = np.load('vessel_mask_pred.npy')
learned_mask_pred = np.load('learned_mask_pred.npy')
learned_mask_pred = learned_mask_pred.reshape([1, 256, 256, 1])
vessel_mas... | [
"numpy.load",
"data.full_mask_generator"
] | [((117, 140), 'numpy.load', 'np.load', (['"""real_img.npy"""'], {}), "('real_img.npy')\n", (124, 140), True, 'import numpy as np\n'), ((160, 191), 'numpy.load', 'np.load', (['"""vessel_mask_pred.npy"""'], {}), "('vessel_mask_pred.npy')\n", (167, 191), True, 'import numpy as np\n'), ((212, 244), 'numpy.load', 'np.load',... |
"""Provide a generic class for template-based file export.
All file representations with template-based write methods inherit from this class.
Copyright (c) 2022 <NAME>
For further information see https://github.com/peter88213/PyWriter
Published under the MIT License (https://opensource.org/licenses/mit-license... | [
"string.Template",
"pywriter.file.filter.Filter",
"os.path.isfile",
"os.path.normpath",
"os.replace"
] | [((2295, 2303), 'pywriter.file.filter.Filter', 'Filter', ([], {}), '()\n', (2301, 2303), False, 'from pywriter.file.filter import Filter\n'), ((2335, 2343), 'pywriter.file.filter.Filter', 'Filter', ([], {}), '()\n', (2341, 2343), False, 'from pywriter.file.filter import Filter\n'), ((2377, 2385), 'pywriter.file.filter.... |
"""Constructors for concrete tool and input source objects."""
import logging
from uuid import uuid4
from galaxy.tool_util.loader import load_tool_with_refereces
from galaxy.util.yaml_util import ordered_load
from .cwl import CwlToolSource
from .interface import InputSource
from .xml import XmlInputSource, XmlToolSou... | [
"galaxy.util.yaml_util.ordered_load",
"uuid.uuid4",
"galaxy.tool_util.loader.load_tool_with_refereces",
"logging.getLogger"
] | [((423, 450), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (440, 450), False, 'import logging\n'), ((1297, 1334), 'galaxy.tool_util.loader.load_tool_with_refereces', 'load_tool_with_refereces', (['config_file'], {}), '(config_file)\n', (1321, 1334), False, 'from galaxy.tool_util.loader ... |
import argparse
import logging
import os
import sys
import __init__ # noqa: F401
import build_migrator.modules
import build_migrator.settings
from build_migrator import BuildMigrator
from build_migrator.helpers import ArgumentParserNoError
def _add_arguments(parser, add_help=True):
if add_help:
parser.a... | [
"argparse.ArgumentParser",
"logging.basicConfig",
"os.getcwd",
"os.path.exists",
"build_migrator.helpers.ArgumentParserNoError",
"build_migrator.BuildMigrator",
"os.path.join"
] | [((1720, 1757), 'build_migrator.helpers.ArgumentParserNoError', 'ArgumentParserNoError', ([], {'add_help': '(False)'}), '(add_help=False)\n', (1741, 1757), False, 'from build_migrator.helpers import ArgumentParserNoError\n'), ((2745, 2807), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""build_m... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Hewlett Packard Enterprise Development LP
#
# 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
... | [
"collections.OrderedDict",
"topology.platforms.utils.NodeLoader",
"traceback.format_exc",
"logging.getLogger"
] | [((1051, 1070), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (1060, 1070), False, 'from logging import getLogger\n'), ((1233, 1297), 'topology.platforms.utils.NodeLoader', 'NodeLoader', (['"""connect"""'], {'api_version': '"""1.0"""', 'base_class': 'ConnectNode'}), "('connect', api_version='1.0... |
from unittest import TestCase
from PascalsTriangle import PascalsTriangle
class TestPascalsTriangle(TestCase):
def test_generate(self):
pt = PascalsTriangle()
lists = []
self.assertEqual(pt.generate(0), lists)
lists.append([1])
self.assertEqual(pt.generate(1), lists)
... | [
"PascalsTriangle.PascalsTriangle"
] | [((156, 173), 'PascalsTriangle.PascalsTriangle', 'PascalsTriangle', ([], {}), '()\n', (171, 173), False, 'from PascalsTriangle import PascalsTriangle\n')] |
"""
LOO-PIT Overlay Plot
====================
_thumb: .5, .7
"""
import arviz as az
az.style.use("arviz-darkgrid")
idata = az.load_arviz_data("non_centered_eight")
az.plot_loo_pit(idata=idata, y="obs", color="indigo")
| [
"arviz.style.use",
"arviz.plot_loo_pit",
"arviz.load_arviz_data"
] | [((86, 116), 'arviz.style.use', 'az.style.use', (['"""arviz-darkgrid"""'], {}), "('arviz-darkgrid')\n", (98, 116), True, 'import arviz as az\n'), ((126, 166), 'arviz.load_arviz_data', 'az.load_arviz_data', (['"""non_centered_eight"""'], {}), "('non_centered_eight')\n", (144, 166), True, 'import arviz as az\n'), ((168, ... |
import time
import random
import subprocess
from pyplayground.client.RobotThymio2 import RobotThymio2
from pyplayground.client.RobotEPuck import RobotEPuck
# Requiere servidor en el playground "simple.world"
class TestLed():
def __init__( self ):
pass
def run( self ):
# Levantamos el playgrou... | [
"pyplayground.client.RobotThymio2.RobotThymio2",
"pyplayground.client.RobotEPuck.RobotEPuck",
"time.time",
"time.sleep"
] | [((495, 508), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (505, 508), False, 'import time\n'), ((859, 896), 'pyplayground.client.RobotThymio2.RobotThymio2', 'RobotThymio2', (['"""Thymio-01"""', 'host', 'port'], {}), "('Thymio-01', host, port)\n", (871, 896), False, 'from pyplayground.client.RobotThymio2 import ... |
from django.shortcuts import render #, get_object_or_404
from django.http import JsonResponse, HttpResponseForbidden, HttpResponse
import json
import csv
from .controllers import fetch_all, get_search_results, update_search, IS_LEARNING
from eeia_moteur_recherche.settings import DEBUG
# HOME
def index(request):
ret... | [
"csv.writer",
"django.http.HttpResponse",
"django.http.HttpResponseForbidden",
"django.http.JsonResponse",
"django.shortcuts.render"
] | [((324, 360), 'django.shortcuts.render', 'render', (['request', '"""moteur/index.html"""'], {}), "(request, 'moteur/index.html')\n", (330, 360), False, 'from django.shortcuts import render\n'), ((742, 776), 'django.http.JsonResponse', 'JsonResponse', (['response'], {'safe': '(False)'}), '(response, safe=False)\n', (754... |
"""
Module containing classes for storing detector data.
``SERPENT`` is capable of producing detectors, or tallies from MCNP,
with a variety of bin structures. These include, but are not limited to,
material regions, reaction types, energy bins, spatial meshes, and
universe bins.
The detectors contained in this modul... | [
"matplotlib.patches.RegularPolygon",
"serpentTools.objects.base.NamedObject.__init__",
"numpy.arange",
"matplotlib.pyplot.gca",
"numpy.unique",
"serpentTools.utils.formatPlot",
"serpentTools.utils.normalizerFactory",
"serpentTools.utils.setAx_xlims",
"serpentTools.messages.BAD_OBJ_SUBJ.format",
"n... | [((5464, 5496), 'serpentTools.objects.base.NamedObject.__init__', 'NamedObject.__init__', (['self', 'name'], {}), '(self, name)\n', (5484, 5496), False, 'from serpentTools.objects.base import NamedObject\n'), ((10871, 10891), 'numpy.asfortranarray', 'asfortranarray', (['bins'], {}), '(bins)\n', (10885, 10891), False, '... |
import os
import sys
import argparse
import numpy as np
import re
import skimage.io as io
parser = argparse.ArgumentParser(description = 'Normalize images to camera \
background signal image.')
parser.add_argument('-d', '--img_dir', required = True,
help = 'directo... | [
"os.listdir",
"os.mkdir",
"argparse.ArgumentParser",
"numpy.copy",
"os.path.isdir",
"numpy.mean",
"re.search",
"os.chdir",
"skimage.io.imread",
"re.compile"
] | [((100, 233), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Normalize images to camera background signal image."""'}), "(description=\n 'Normalize images to camera background signal image.'\n )\n", (123, 233), False... |
import sys
from argparse import ArgumentParser
from getpass import getpass
from os import name as os_name
from progressbar import ProgressBar
from manga_py.fs import check_free_space, get_temp_path
from manga_py.parser import Parser
class Cli: # pragma: no cover
args = None
parser = None
_info = None
... | [
"manga_py.parser.Parser",
"getpass.getpass",
"manga_py.fs.check_free_space",
"manga_py.fs.get_temp_path",
"progressbar.ProgressBar"
] | [((463, 475), 'manga_py.parser.Parser', 'Parser', (['args'], {}), '(args)\n', (469, 475), False, 'from manga_py.parser import Parser\n'), ((3438, 3452), 'getpass.getpass', 'getpass', (['title'], {}), '(title)\n', (3445, 3452), False, 'from getpass import getpass\n'), ((1921, 1934), 'progressbar.ProgressBar', 'ProgressB... |
import logging
import os
from typing import List, Set, Tuple
from ssrfmap.core.utils import diff_text, wrapper_http
name = "gce"
description = "Access sensitive data from GCE"
author = "mrtc0"
documentation: List[str] = [
"https://cloud.google.com/compute/docs/storing-retrieving-metadata",
"https://hackerone.... | [
"ssrfmap.core.utils.diff_text",
"ssrfmap.core.utils.wrapper_http",
"logging.debug"
] | [((808, 852), 'ssrfmap.core.utils.wrapper_http', 'wrapper_http', (['endpoint[1]', 'endpoint[0]', '"""80"""'], {}), "(endpoint[1], endpoint[0], '80')\n", (820, 852), False, 'from ssrfmap.core.utils import diff_text, wrapper_http\n'), ((938, 964), 'ssrfmap.core.utils.diff_text', 'diff_text', (['r.text', 'default'], {}), ... |
import os
from enum import Enum
import jwt
from flask import request
from src.exceptions import UnauthorizedException
class Permission(Enum):
READ = 'read'
WRITE = 'write'
@staticmethod
def has_value(val):
try:
Permission(val)
except ValueError:
return False
... | [
"os.environ.get",
"src.exceptions.UnauthorizedException"
] | [((908, 936), 'os.environ.get', 'os.environ.get', (['"""JWT_SECRET"""'], {}), "('JWT_SECRET')\n", (922, 936), False, 'import os\n'), ((1444, 1505), 'src.exceptions.UnauthorizedException', 'UnauthorizedException', (['"""No "Authorization" header in request"""'], {}), '(\'No "Authorization" header in request\')\n', (1465... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__... | [
"pulumi.get",
"pulumi.getter",
"pulumi.ResourceOptions",
"pulumi.set"
] | [((5085, 5116), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""requestId"""'}), "(name='requestId')\n", (5098, 5116), False, 'import pulumi\n'), ((11938, 11977), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""creationTimestamp"""'}), "(name='creationTimestamp')\n", (11951, 11977), False, 'import pulumi\n'), (... |
#
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""Test the status endpoint view."""
import logging
import re
from collections import namedtuple
from datetime import datetime
from subprocess import CompletedProcess
from subprocess import PIPE
from unittest.mock import ANY
from unittest.mock impo... | [
"django.db.InterfaceError",
"unittest.mock.Mock",
"unittest.mock.patch",
"logging.disable",
"datetime.datetime.strptime",
"django.urls.reverse",
"collections.namedtuple",
"django.test.utils.override_settings",
"masu.api.status.ApplicationStatus",
"re.compile"
] | [((737, 780), 'django.test.utils.override_settings', 'override_settings', ([], {'ROOT_URLCONF': '"""masu.urls"""'}), "(ROOT_URLCONF='masu.urls')\n", (754, 780), False, 'from django.test.utils import override_settings\n'), ((988, 1076), 'unittest.mock.patch', 'patch', (['"""masu.api.status.ApplicationStatus.celery_statu... |
import setuptools
from os import path
# read the contents of your README file
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setuptools.setup(
name="jupyter-pgweb-proxy",
version="0.2.0",
url... | [
"os.path.dirname",
"os.path.join",
"setuptools.find_packages"
] | [((110, 132), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (122, 132), False, 'from os import path\n'), ((144, 182), 'os.path.join', 'path.join', (['this_directory', '"""README.md"""'], {}), "(this_directory, 'README.md')\n", (153, 182), False, 'from os import path\n'), ((534, 560), 'setuptool... |
from faker import Faker
fake = Faker()
| [
"faker.Faker"
] | [((33, 40), 'faker.Faker', 'Faker', ([], {}), '()\n', (38, 40), False, 'from faker import Faker\n')] |
"""
MIT License
Copyright (c) 2020 Airbyte
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, distr... | [
"airbyte_protocol.AirbyteConnectionStatus",
"requests.get"
] | [((1429, 1526), 'requests.get', 'requests.get', (['"""https://api.stripe.com/v1/customers"""'], {'auth': "(json_config['client_secret'], '')"}), "('https://api.stripe.com/v1/customers', auth=(json_config[\n 'client_secret'], ''))\n", (1441, 1526), False, 'import requests\n'), ((1582, 1630), 'airbyte_protocol.Airbyte... |
import json
filename = input("Enter your train data filename : ")
print(filename)
with open(filename) as train_data:
train = json.load(train_data)
TRAIN_DATA = []
for data in train:
ents = [tuple(entity) for entity in data['entities']]
TRAIN_DATA.append((data['content'],{'entities':ents}))
with open('{}'.forma... | [
"json.load"
] | [((129, 150), 'json.load', 'json.load', (['train_data'], {}), '(train_data)\n', (138, 150), False, 'import json\n')] |
import json
import math
import random
from itertools import count
from pathlib import Path
from typing import List, Optional
import numpy as np
import torch
import torch.optim as optim
from torch import nn
from torch.functional import Tensor
from mouse.agent.network import DQN
from mouse.environment.steinmetz import ... | [
"mouse.util.resize",
"torch.cat",
"mouse.model.trial.Trial",
"torch.no_grad",
"mouse.util.ReplayMemory",
"torch.flatten",
"mouse.util.plot_durations",
"torch.zeros",
"numpy.dstack",
"json.dump",
"itertools.count",
"random.random",
"mouse.model.trial.Dataset",
"torch.cuda.is_available",
"... | [((3214, 3259), 'mouse.util.plot_durations_final', 'plot_durations_final', (['self._episode_durations'], {}), '(self._episode_durations)\n', (3234, 3259), False, 'from mouse.util import ReplayMemory, plot_durations, plot_durations_final, resize\n'), ((4020, 4077), 'torch.cat', 'torch.cat', (['[s for s in batch.next_sta... |
from datetime import datetime
from uuid import uuid4
from fastapi import Depends, FastAPI
from clients.game_service import Client
from db.client import DBClient
from db.schemas.game import Game as GameSchema
from ..auth import oauth2_scheme
from ..auth.util import decode_auth_token
from .schemas import (AwaitingGame... | [
"uuid.uuid4",
"clients.game_service.Client",
"db.client.DBClient",
"datetime.datetime.utcnow",
"fastapi.Depends",
"fastapi.FastAPI"
] | [((414, 423), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (421, 423), False, 'from fastapi import Depends, FastAPI\n'), ((437, 447), 'db.client.DBClient', 'DBClient', ([], {}), '()\n', (445, 447), False, 'from db.client import DBClient\n'), ((488, 496), 'clients.game_service.Client', 'Client', ([], {}), '()\n', (49... |
#!/usr/bin/env python
# This file is part of VoltDB.
# Copyright (C) 2008-2018 VoltDB Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your... | [
"math.atan2",
"gssapi.SecurityContext",
"socket.socket",
"gssapi.Name",
"ssl.wrap_socket",
"struct.unpack_from",
"gssapi.creds.Credentials",
"hashlib.sha256",
"array.array",
"math.cos",
"re.search",
"math.sqrt",
"math.sin",
"struct.calcsize",
"jks.KeyStore.load",
"datetime.datetime.fro... | [((1372, 1392), 'decimal.getcontext', 'decimal.getcontext', ([], {}), '()\n', (1390, 1392), False, 'import decimal\n'), ((2124, 2145), 'array.array', 'array.array', (['"""d"""', '[d]'], {}), "('d', [d])\n", (2135, 2145), False, 'import array\n'), ((44786, 44898), 're.compile', 're.compile', (['"""^\\\\s*point\\\\s*\\\\... |
import glob
import pandas as pd
def create_report_dictionary(report_list, seq_list, id_column):
"""
:param report_list: List of paths to report files
:param seq_list: List of OLC Seq IDs
:param id_column: Column used to specify primary key
:return: Dictionary containing Seq IDs as keys and datafra... | [
"pandas.read_csv",
"glob.glob"
] | [((1314, 1401), 'glob.glob', 'glob.glob', (['"""/home/dussaultf/Documents/COWBAT_TEST_V2/reports/combinedMetadata.csv"""'], {}), "(\n '/home/dussaultf/Documents/COWBAT_TEST_V2/reports/combinedMetadata.csv')\n", (1323, 1401), False, 'import glob\n'), ((1939, 2009), 'glob.glob', 'glob.glob', (['"""/home/dussaultf/Docu... |
from nanome.util import Vector3
class _UnitCell(object):
def __init__(self):
self._A = 0.0
self._B = 0.0
self._C = 0.0
self._Alpha = 0.0
self._Beta = 0.0
self._Gamma = 0.0
self._Origin = Vector3()
| [
"nanome.util.Vector3"
] | [((251, 260), 'nanome.util.Vector3', 'Vector3', ([], {}), '()\n', (258, 260), False, 'from nanome.util import Vector3\n')] |
import numpy as np
import tensorflow as tf
import gym
EPS = 1e-8
def placeholder(dim=None):
#TODO not entirely sure if that's a very good way of dealing with this.
if isinstance(dim, gym.spaces.Dict):
return {sub_key:placeholder(sub_dim) for sub_key, sub_dim in dim.spaces.items()}
elif isinstance(... | [
"tensorflow.reduce_sum",
"numpy.log",
"tensorflow.clip_by_value",
"tensorflow.layers.dense",
"tensorflow.variable_scope",
"tensorflow.concat",
"tensorflow.placeholder",
"tensorflow.global_variables",
"tensorflow.shape",
"tensorflow.exp",
"tensorflow.nn.softplus",
"tensorflow.tanh"
] | [((787, 859), 'tensorflow.layers.dense', 'tf.layers.dense', (['x'], {'units': 'hidden_sizes[-1]', 'activation': 'output_activation'}), '(x, units=hidden_sizes[-1], activation=output_activation)\n', (802, 859), True, 'import tensorflow as tf\n'), ((1195, 1225), 'tensorflow.reduce_sum', 'tf.reduce_sum', (['pre_sum'], {'a... |
# %% Import packages
from kanga.chains import ChainArray
from bnn_mcmc_examples.examples.mlp.pima.setting2.constants import diagnostic_iter_thres
from bnn_mcmc_examples.examples.mlp.pima.setting2.hmc.constants import sampler_output_pilot_path
# %% Load chain array
chain_array = ChainArray.from_file(keys=['sample', ... | [
"kanga.chains.ChainArray.from_file"
] | [((283, 369), 'kanga.chains.ChainArray.from_file', 'ChainArray.from_file', ([], {'keys': "['sample', 'accepted']", 'path': 'sampler_output_pilot_path'}), "(keys=['sample', 'accepted'], path=\n sampler_output_pilot_path)\n", (303, 369), False, 'from kanga.chains import ChainArray\n')] |
from ossConfig import ossConfig
import Oss
access_key = '<KEY>'
secret_key = '<KEY>'
endpoint_url = 'http://XXXXXXXXXXXXXXXXX.com'
config = ossConfig(access_key, secret_key, endpoint_url)
bucket_name = 'd11111111'
if Oss.delete_bucket(config, bucket_name):
print("delete bucket sucess!")
else:
print("delete bu... | [
"ossConfig.ossConfig",
"Oss.bucket_exists",
"Oss.delete_bucket"
] | [((141, 188), 'ossConfig.ossConfig', 'ossConfig', (['access_key', 'secret_key', 'endpoint_url'], {}), '(access_key, secret_key, endpoint_url)\n', (150, 188), False, 'from ossConfig import ossConfig\n'), ((219, 257), 'Oss.delete_bucket', 'Oss.delete_bucket', (['config', 'bucket_name'], {}), '(config, bucket_name)\n', (2... |
import unittest
import os
import sys
import shutil
import tempfile
import yaml
from contextlib import contextmanager
import poco_ops.poco as poco
from ..services.file_utils import FileUtils
from ..services.state import StateHolder
from ..services.console_logger import ColorPrint
try:
from StringIO import StringIO
e... | [
"os.path.expanduser",
"io.StringIO",
"os.makedirs",
"os.getcwd",
"yaml.dump",
"tempfile.mkdtemp",
"shutil.rmtree",
"os.path.join",
"os.chdir"
] | [((788, 824), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {'prefix': '"""poco-home"""'}), "(prefix='poco-home')\n", (804, 824), False, 'import tempfile\n'), ((847, 878), 'os.path.join', 'os.path.join', (['self.tmpdir', '"""ws"""'], {}), "(self.tmpdir, 'ws')\n", (859, 878), False, 'import os\n'), ((887, 911), 'os.maked... |
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import sys
from spack import *
from spack.operating_systems.mac_os import macos_version
# Trilinos is complicat... | [
"spack.operating_systems.mac_os.macos_version"
] | [((31532, 31547), 'spack.operating_systems.mac_os.macos_version', 'macos_version', ([], {}), '()\n', (31545, 31547), False, 'from spack.operating_systems.mac_os import macos_version\n')] |
import FWCore.ParameterSet.Config as cms
import copy
from ElectroWeakAnalysis.ZMuMu.zSelection_cfi import *
# same charge dimuons....
dimuonsGlobalSameCharge = cms.EDFilter(
"CandViewRefSelector",
### added UserData
src = cms.InputTag("userDataDimuons"),
##src = cms.InputTag("dimuons"),
cut = cms.... | [
"FWCore.ParameterSet.Config.string",
"copy.deepcopy",
"FWCore.ParameterSet.Config.InputTag",
"FWCore.ParameterSet.Config.bool"
] | [((632, 764), 'FWCore.ParameterSet.Config.string', 'cms.string', (['"""charge!=0 & daughter(0).pt > 10 & daughter(1).pt > 10 & abs(daughter(0).eta)<2.1 & abs(daughter(1).eta)<2.1 """'], {}), "(\n 'charge!=0 & daughter(0).pt > 10 & daughter(1).pt > 10 & abs(daughter(0).eta)<2.1 & abs(daughter(1).eta)<2.1 '\n )\n",... |
# example of plotting the adam search on a contour plot of the test function
from math import sqrt
from numpy import asarray
from numpy import arange
from numpy.random import rand
from numpy.random import seed
from numpy import meshgrid
from matplotlib import pyplot
from mpl_toolkits.mplot3d import Axes3D
# objective ... | [
"numpy.meshgrid",
"numpy.random.seed",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"math.sqrt",
"numpy.asarray",
"numpy.arange",
"matplotlib.pyplot.contourf"
] | [((1757, 1764), 'numpy.random.seed', 'seed', (['(1)'], {}), '(1)\n', (1761, 1764), False, 'from numpy.random import seed\n'), ((1799, 1834), 'numpy.asarray', 'asarray', (['[[-1.0, 1.0], [-1.0, 1.0]]'], {}), '([[-1.0, 1.0], [-1.0, 1.0]])\n', (1806, 1834), False, 'from numpy import asarray\n'), ((2179, 2218), 'numpy.aran... |
from django.db import models
from apps.laboratorio.models import Laboratorio
from apps.grupo.models import Grupo
from apps.subgrupo.models import Subgrupo
# Create your models here.
class Medicamento(models.Model):
cod_med = models.CharField(max_length=10, default='')
principio_activo_med = models.CharField(ma... | [
"django.db.models.CharField",
"django.db.models.DateTimeField",
"django.db.models.ForeignKey"
] | [((230, 273), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(10)', 'default': '""""""'}), "(max_length=10, default='')\n", (246, 273), False, 'from django.db import models\n'), ((301, 333), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (3... |
# -*- coding: utf-8 -*-
# Copyright 2012 Managed I.T.
#
# Author: <NAME> <<EMAIL>>
#
# 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
#
# Unle... | [
"oslo_db.exception.DBDeadlock",
"oslo_log.log.getLogger",
"designate.objects.Domain.from_dict",
"designate.objects.Record.from_dict",
"designate.objects.FloatingIP",
"designate.objects.PoolNsRecord",
"testtools.matchers.GreaterThan",
"random.randint",
"mock.patch.object",
"copy.deepcopy",
"desig... | [((1010, 1037), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1027, 1037), True, 'from oslo_log import log as logging\n'), ((14868, 14912), 'mock.patch.object', 'mock.patch.object', (['notifier.Notifier', '"""info"""'], {}), "(notifier.Notifier, 'info')\n", (14885, 14912), False, '... |
from great_expectations.cli import toolkit
from great_expectations.cli.cli_logging import logger
from great_expectations.cli.pretty_printing import cli_message
def build_docs(context, site_name=None, view=True, assume_yes=False):
"""Build documentation in a context"""
logger.debug("Starting cli.datasource.bui... | [
"great_expectations.cli.toolkit.confirm_proceed_or_exit",
"great_expectations.cli.pretty_printing.cli_message",
"great_expectations.cli.cli_logging.logger.debug"
] | [((279, 329), 'great_expectations.cli.cli_logging.logger.debug', 'logger.debug', (['"""Starting cli.datasource.build_docs"""'], {}), "('Starting cli.datasource.build_docs')\n", (291, 329), False, 'from great_expectations.cli.cli_logging import logger\n'), ((795, 811), 'great_expectations.cli.pretty_printing.cli_message... |
import collections
import unittest
from typing import List
import utils
# O(V+E) time. O(V) space. BFS.
class Solution:
def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool:
graph = [[] for _ in range(numCourses)]
in_degrees = [0] * numCourses
for successor, prede... | [
"unittest.main",
"utils.test",
"collections.deque"
] | [((1002, 1017), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1015, 1017), False, 'import unittest\n'), ((446, 465), 'collections.deque', 'collections.deque', ([], {}), '()\n', (463, 465), False, 'import collections\n'), ((932, 968), 'utils.test', 'utils.test', (['self', '__file__', 'Solution'], {}), '(self, __f... |
import logging
import settings
from handlers import (find_planet, greet_user, guess_number, send_shrek_picture,
user_coordinates, talk_to_me, check_user_photo)
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
logging.basicConfig(format='%(name)s - %(levelname)s - %(message... | [
"logging.basicConfig",
"telegram.ext.Updater",
"telegram.ext.MessageHandler",
"telegram.ext.CommandHandler",
"telegram.ext.Filters.regex"
] | [((256, 369), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(name)s - %(levelname)s - %(message)s"""', 'level': 'logging.INFO', 'filename': '"""bot.log"""'}), "(format='%(name)s - %(levelname)s - %(message)s', level=\n logging.INFO, filename='bot.log')\n", (275, 369), False, 'import logging\n'),... |
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template.loader import get_template
from django.template import Context
from django.core.cache import cache
from app.models import *
import urllib
import urllib2
from math import floor
from time import... | [
"django.shortcuts.render_to_response"
] | [((394, 426), 'django.shortcuts.render_to_response', 'render_to_response', (['"""index.html"""'], {}), "('index.html')\n", (412, 426), False, 'from django.shortcuts import render_to_response\n')] |
# Copyright 2014 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
#
# https://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | [
"logging.getLogger",
"boto3.client"
] | [((621, 648), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (638, 648), False, 'import logging\n'), ((3153, 3189), 'boto3.client', 'boto3.client', (['self.meta.service_name'], {}), '(self.meta.service_name)\n', (3165, 3189), False, 'import boto3\n')] |
from __future__ import annotations
import os
import subprocess
import sys
from pathlib import Path
from textwrap import dedent
import pytest
# To prevent CoverageWarning in the main process:
import pytest_is_running # noqa: F401
@pytest.fixture()
def our_tmp_path(tmp_path):
(tmp_path / "sitecustomize.py").wri... | [
"textwrap.dedent",
"subprocess.run",
"pathlib.Path",
"pytest.fixture"
] | [((236, 252), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (250, 252), False, 'import pytest\n'), ((722, 785), 'subprocess.run', 'subprocess.run', (['([sys.executable] + command)'], {'check': '(True)', 'env': 'env'}), '([sys.executable] + command, check=True, env=env)\n', (736, 785), False, 'import subprocess\... |
# _*_ coding: utf-8 _*_
import json
import pathlib
from typing import TYPE_CHECKING, Any, Callable, Union, cast, no_type_check
from pydantic.parse import Protocol
from pydantic.parse import load_file as default_load_file
from pydantic.parse import load_str_bytes as default_load_str_bytes
from pydantic.types import Str... | [
"typing.cast",
"pathlib.Path",
"pydantic.parse.load_file",
"pydantic.parse.load_str_bytes"
] | [((2633, 2772), 'pydantic.parse.load_str_bytes', 'default_load_str_bytes', (['b'], {'proto': 'proto', 'content_type': 'content_type', 'encoding': 'encoding', 'allow_pickle': 'allow_pickle', 'json_loads': 'json_loads'}), '(b, proto=proto, content_type=content_type, encoding=\n encoding, allow_pickle=allow_pickle, jso... |
from __future__ import unicode_literals
import re
from django.core.validators import MaxValueValidator, RegexValidator
from django.db import models
from django.test import TestCase
from rest_framework import generics, serializers, status
from rest_framework.test import APIRequestFactory
factory = APIRequestFactory(... | [
"rest_framework.serializers.ChoiceField",
"re.compile",
"django.db.models.CharField",
"rest_framework.test.APIRequestFactory",
"rest_framework.serializers.CharField",
"django.core.validators.MaxValueValidator",
"rest_framework.serializers.as_serializer_error",
"rest_framework.serializers.ValidationErr... | [((302, 321), 'rest_framework.test.APIRequestFactory', 'APIRequestFactory', ([], {}), '()\n', (319, 321), False, 'from rest_framework.test import APIRequestFactory\n'), ((412, 444), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)'}), '(max_length=255)\n', (428, 444), False, 'from django.db ... |
import sqlite3 as sq
conn=sq.connect('db')
cursor = conn.cursor()
cursor.execute("""CREATE TABLE IF NOT EXISTS book (id INTEGER PRIMARY KEY autoincrement , title TEXT,
author TEXT, year INTEGER, isbn INTEGER);""")
conn.commit()
def insert(title, author, year, isbn):
cur... | [
"sqlite3.connect"
] | [((33, 49), 'sqlite3.connect', 'sq.connect', (['"""db"""'], {}), "('db')\n", (43, 49), True, 'import sqlite3 as sq\n')] |
# -*- coding: utf8 -*-
from __future__ import unicode_literals
from collections import defaultdict
from inspectors import Inspectors
class InspectorsFactory(object):
"""
Manages the creation and hooking up of inspectors to the agent.
All inspector creations should be done in the factory.
All hooks s... | [
"collections.defaultdict"
] | [((851, 868), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (862, 868), False, 'from collections import defaultdict\n')] |
# -*- coding: utf-8 -*-
# Copyright (c) 2019 Uber Technologies, Inc.
#
# 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 ... | [
"tests.integration_tests.utils.generate_data",
"subprocess.run",
"json.load",
"os.remove",
"tests.integration_tests.utils.sequence_feature",
"tests.integration_tests.utils.bag_feature",
"ludwig.experiment.experiment_cli",
"ludwig.visualize._extract_ground_truth_values",
"tests.integration_tests.util... | [((2717, 2739), 'ludwig.experiment.experiment_cli', 'experiment_cli', ([], {}), '(**args)\n', (2731, 2739), False, 'from ludwig.experiment import experiment_cli\n'), ((3179, 3227), 'os.path.join', 'os.path.join', (['experiment_dir', '"""description.json"""'], {}), "(experiment_dir, 'description.json')\n", (3191, 3227),... |
from constants import *
from ZurichInstruments_UHFLI import ZurichInstruments_UHFLI
import sys
import os
import shutil
import qt
import progressbar
import numpy as np
import time
def awg_program(rlength, rphase):
awg_program = '''
const us = 1e-6;
const cycle = 4.4e-9;
const opt_phase = -1.710238;
... | [
"ZurichInstruments_UHFLI.ZurichInstruments_UHFLI",
"os.path.basename",
"time.time",
"qt.Data",
"qt.instruments.create"
] | [((2762, 2796), 'ZurichInstruments_UHFLI.ZurichInstruments_UHFLI', 'ZurichInstruments_UHFLI', (['"""dev2232"""'], {}), "('dev2232')\n", (2785, 2796), False, 'from ZurichInstruments_UHFLI import ZurichInstruments_UHFLI\n'), ((2804, 2904), 'qt.instruments.create', 'qt.instruments.create', (['"""RTE1104"""', '"""RhodeSchw... |
import unittest
import enocean
from enocean.protocol.constants import PACKET
from src.common.eep import Eep
from src.enocean_packet_factory import EnoceanPacketFactory
from src.tools.enocean_tools import EnoceanTools
from src.tools.pickle_tools import PickleTools
from test.setup_test import SetupTest
class TestEnoc... | [
"src.common.eep.Eep",
"test.setup_test.SetupTest.set_dummy_sender_id",
"src.tools.enocean_tools.EnoceanTools.int_to_byte_list",
"src.tools.pickle_tools.PickleTools.pickle_packet",
"src.tools.pickle_tools.PickleTools.unpickle_packet",
"src.tools.enocean_tools.EnoceanTools.packet_type_to_string",
"enocean... | [((379, 410), 'test.setup_test.SetupTest.set_dummy_sender_id', 'SetupTest.set_dummy_sender_id', ([], {}), '()\n', (408, 410), False, 'from test.setup_test import SetupTest\n'), ((539, 568), 'src.common.eep.Eep', 'Eep', ([], {'rorg': '(246)', 'func': '(2)', 'type': '(2)'}), '(rorg=246, func=2, type=2)\n', (542, 568), Fa... |
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: <NAME>
## ECE Department, Rutgers University
## Email: <EMAIL>
## Copyright (c) 2017
##
## This source code is licensed under the MIT-style license found in the
## LICENSE file in the root directory of this source tree
##++++++++... | [
"numpy.random.seed",
"time.ctime",
"utils.init_vgg16",
"os.path.join",
"option.Options",
"torch.nn.MSELoss",
"utils.add_imagenet_mean_batch",
"torch.utils.data.DataLoader",
"torchvision.transforms.Scale",
"utils.tensor_save_bgrimage",
"os.path.dirname",
"torch.load",
"utils.gram_matrix",
"... | [((1583, 1672), 'utils.tensor_load_rgbimage', 'utils.tensor_load_rgbimage', (['args.content_image'], {'size': 'args.content_size', 'keep_asp': '(True)'}), '(args.content_image, size=args.content_size,\n keep_asp=True)\n', (1609, 1672), False, 'import utils\n'), ((1825, 1874), 'utils.subtract_imagenet_mean_batch', 'u... |
import poa
with open('test.pasm', 'r') as fp:
tokens, lnotab = poa.parse_opcode_file(fp)
code = poa.assemble_instructionflow(tokens)
compiled = poa.make_function(
argcount=1,
posonlyargcount=0,
kwonlyargcount=0,
nlocals=2,
stacksize=poa.calc_stacksize(tokens),
flags=0,
codestring=c... | [
"poa.calc_stacksize",
"poa.assemble_instructionflow",
"poa.parse_opcode_file"
] | [((68, 93), 'poa.parse_opcode_file', 'poa.parse_opcode_file', (['fp'], {}), '(fp)\n', (89, 93), False, 'import poa\n'), ((105, 141), 'poa.assemble_instructionflow', 'poa.assemble_instructionflow', (['tokens'], {}), '(tokens)\n', (133, 141), False, 'import poa\n'), ((263, 289), 'poa.calc_stacksize', 'poa.calc_stacksize'... |
''' Controller para fornecer dados da CEE '''
from flask import request
from flask_restful_swagger_2 import swagger
from resources.base import BaseResource
class CensoAgroBrasilResource(BaseResource):
''' Classe de múltiplas incidências '''
CUSTOM_SWAGGER_PARAMS = [
{"name": "categorias", "required": T... | [
"flask_restful_swagger_2.swagger.doc"
] | [((662, 962), 'flask_restful_swagger_2.swagger.doc', 'swagger.doc', (["{'tags': ['censo_agro'], 'description':\n 'Obtém todos os dados do censo de áreas rurais, de acordo com os parâmetros informados.'\n , 'parameters': CUSTOM_SWAGGER_PARAMS + BaseResource.\n DEFAULT_SWAGGER_PARAMS, 'responses': {'... |
#!/usr/bin/python
import os
import sys
current_path = os.path.dirname(os.path.abspath(__file__))
project_path = os.path.dirname(current_path)
sys.path.append(project_path)
from core.hibench import *
def gen_data(custom_conf, workload):
beaver_env = get_merged_env(custom_conf)
gen_hibench_data(beaver_env, work... | [
"sys.path.append",
"os.path.dirname",
"os.path.abspath"
] | [((112, 141), 'os.path.dirname', 'os.path.dirname', (['current_path'], {}), '(current_path)\n', (127, 141), False, 'import os\n'), ((142, 171), 'sys.path.append', 'sys.path.append', (['project_path'], {}), '(project_path)\n', (157, 171), False, 'import sys\n'), ((70, 95), 'os.path.abspath', 'os.path.abspath', (['__file... |
import numpy as np
import ctypes as ct
import DateTimeTools as TT
c_str = ct.c_char_p
c_bool = ct.c_bool
c_int = ct.c_int
c_float = ct.c_float
c_double = ct.c_double
c_int_ptr = np.ctypeslib.ndpointer(ct.c_int,flags="C_CONTIGUOUS")
c_float_ptr = np.ctypeslib.ndpointer(ct.c_float,flags="C_CONTIGUOUS")
c_double_ptr = np... | [
"DateTimeTools.DectoHHMM",
"numpy.arctan2",
"numpy.ctypeslib.ndpointer",
"DateTimeTools.DayNo",
"numpy.zeros",
"numpy.arcsin",
"numpy.array",
"ctypes.CDLL",
"numpy.sqrt"
] | [((179, 233), 'numpy.ctypeslib.ndpointer', 'np.ctypeslib.ndpointer', (['ct.c_int'], {'flags': '"""C_CONTIGUOUS"""'}), "(ct.c_int, flags='C_CONTIGUOUS')\n", (201, 233), True, 'import numpy as np\n'), ((247, 303), 'numpy.ctypeslib.ndpointer', 'np.ctypeslib.ndpointer', (['ct.c_float'], {'flags': '"""C_CONTIGUOUS"""'}), "(... |
import numpy as np
import scipy.io
import os
import math
import matplotlib.pyplot as plt
fs = 27
plt.rc('font', size=fs) #controls default text size
plt.rc('axes', titlesize=fs) #fontsize of the title
plt.rc('axes', labelsize=fs) #fontsize of the x and y labels
plt.rc('xtick', labelsize=fs) #fontsize of the... | [
"numpy.zeros",
"numpy.hstack",
"numpy.sin",
"numpy.array",
"matplotlib.pyplot.rc",
"numpy.cos",
"numpy.arccos",
"numpy.sqrt"
] | [((106, 129), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {'size': 'fs'}), "('font', size=fs)\n", (112, 129), True, 'import matplotlib.pyplot as plt\n'), ((159, 187), 'matplotlib.pyplot.rc', 'plt.rc', (['"""axes"""'], {'titlesize': 'fs'}), "('axes', titlesize=fs)\n", (165, 187), True, 'import matplotlib.pyplot a... |
from typing import Dict, Any, Tuple, Callable
from datetime import timedelta
from spacy.util import registry
from spacy.errors import Errors
from wasabi import msg
@registry.loggers("spacy-ray.ConsoleLogger.v1")
def ray_console_logger():
def setup_printer(
nlp: "Language",
) -> Tuple[Callable[[Dict[st... | [
"datetime.timedelta",
"wasabi.msg.row",
"spacy.util.registry.loggers"
] | [((167, 213), 'spacy.util.registry.loggers', 'registry.loggers', (['"""spacy-ray.ConsoleLogger.v1"""'], {}), "('spacy-ray.ConsoleLogger.v1')\n", (183, 213), False, 'from spacy.util import registry\n'), ((877, 919), 'wasabi.msg.row', 'msg.row', (['table_header'], {'widths': 'table_widths'}), '(table_header, widths=table... |
"""
Python skeleton for data structure
Extends python object to do a few tricks
"""
import json
import bson
import six
import numpy as np
import decimal
from pax.utils import Memoize
from pax.plugins.io import strax_functions
class Model(object):
"""Data modelling base class -- use for subclassing.
Features:... | [
"json.loads",
"decimal.Decimal",
"six.BytesIO",
"numpy.frombuffer",
"numpy.dtype",
"pax.plugins.io.strax_functions.pax_to_records",
"numpy.isfinite",
"numpy.array",
"bson.BSON.decode"
] | [((6806, 6821), 'numpy.dtype', 'np.dtype', (['dtype'], {}), '(dtype)\n', (6814, 6821), True, 'import numpy as np\n'), ((9359, 9395), 'pax.plugins.io.strax_functions.pax_to_records', 'strax_functions.pax_to_records', (['self'], {}), '(self)\n', (9389, 9395), False, 'from pax.plugins.io import strax_functions\n'), ((9774... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-26 04:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('polls', '0011_auto_20170926_0407'),
]
operations = [
migrations.AlterField(... | [
"django.db.models.IntegerField"
] | [((409, 430), 'django.db.models.IntegerField', 'models.IntegerField', ([], {}), '()\n', (428, 430), False, 'from django.db import migrations, models\n')] |
'''
Created on Jul 7, 2016
@author: abhinav
'''
import sys
import base64
import hashlib
import socket
import errno
import codecs
import struct
VER = sys.version_info[0]
_VALID_STATUS_CODES = [1000, 1001, 1002, 1003, 1007, 1008,
1009, 1010, 1011, 3000, 3999, 4000, 4999]
HANDSHAKE_STR = (
"HTTP/1.1 10... | [
"struct.unpack_from",
"struct.pack",
"codecs.getincrementaldecoder"
] | [((1119, 1156), 'codecs.getincrementaldecoder', 'codecs.getincrementaldecoder', (['"""utf-8"""'], {}), "('utf-8')\n", (1147, 1156), False, 'import codecs\n'), ((6140, 6165), 'struct.pack', 'struct.pack', (['"""!H"""', 'status'], {}), "('!H', status)\n", (6151, 6165), False, 'import struct\n'), ((8687, 8712), 'struct.pa... |
from itertools import islice
import pytest
import gym
import numpy as np
from ..utils import check_numpy_array, one_hot
from ..base.errors import InsufficientCacheError, EpisodeDoneError
from .short_term import NStepCache, MonteCarloCache
class MockEnv:
action_space = gym.spaces.Discrete(10)
class TestNStepCa... | [
"numpy.zeros_like",
"numpy.testing.assert_array_equal",
"gym.spaces.Discrete",
"pytest.raises",
"numpy.array",
"numpy.arange"
] | [((277, 300), 'gym.spaces.Discrete', 'gym.spaces.Discrete', (['(10)'], {}), '(10)\n', (296, 300), False, 'import gym\n'), ((629, 681), 'numpy.array', 'np.array', (['[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]'], {}), '([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])\n', (637, 681), True, 'import numpy as np\n'), ((690, 739)... |
#!/home/cc8dm/miniconda3/bin/python
import os,shutil,subprocess,sys,argparse,time
parser = argparse.ArgumentParser()
parser.add_argument("-t","--threads",default="1")
parser.add_argument("-p","--prefix",required=True)
parser.add_argument("-r","--read",required=True)
args = parser.parse_args()
bacteriaDB="/project/b... | [
"argparse.ArgumentParser",
"subprocess.check_call"
] | [((93, 118), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (116, 118), False, 'import os, shutil, subprocess, sys, argparse, time\n'), ((820, 853), 'subprocess.check_call', 'subprocess.check_call', (['kraken_cmd'], {}), '(kraken_cmd)\n', (841, 853), False, 'import os, shutil, subprocess, sys, ... |
import pygame
import colors
import math
import player
import getSpawnCoordinates
import Lists
import constants
import deathCircle
fattyWidth = 40
fattyHeight = 40
class fatty(pygame.sprite.Sprite):
def __init__(self,color,width,height):
# Call the parent class (Sprite) constructor
self.spawnTime ... | [
"Lists.all_sprites_list.add",
"pygame.Surface",
"pygame.font.SysFont",
"Lists.fatty_list.add",
"getSpawnCoordinates.generateCoords",
"Lists.bluefatty_list.add",
"deathCircle.spawndeathCircle",
"Lists.redfatty_list.add",
"pygame.sprite.Sprite.__init__",
"pygame.sprite.spritecollide",
"pygame.time... | [((1883, 1915), 'pygame.font.SysFont', 'pygame.font.SysFont', (['"""Arial"""', '(18)'], {}), "('Arial', 18)\n", (1902, 1915), False, 'import pygame\n'), ((322, 345), 'pygame.time.get_ticks', 'pygame.time.get_ticks', ([], {}), '()\n', (343, 345), False, 'import pygame\n'), ((494, 526), 'pygame.font.SysFont', 'pygame.fon... |
import os
from django.shortcuts import render
from django.conf import settings
from django.http import HttpResponse
from welcome import database
from welcome.models import PageView
def index(request):
return render(request, 'welcome/index.html')
| [
"django.shortcuts.render"
] | [((214, 251), 'django.shortcuts.render', 'render', (['request', '"""welcome/index.html"""'], {}), "(request, 'welcome/index.html')\n", (220, 251), False, 'from django.shortcuts import render\n')] |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='SSS',
version='2.0-p3',
description='Simple Sword Server',
author='<NAME>',
author_email='<EMAIL>',
url='http://www.swordapp.org/',
packages=find_packages(exclude=['tests']),
install_requires=["web.py",
... | [
"setuptools.find_packages"
] | [((250, 282), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['tests']"}), "(exclude=['tests'])\n", (263, 282), False, 'from setuptools import setup, find_packages\n')] |
import json
from django.test import TestCase
from projects.models import Project
class TestProject(TestCase):
fixtures = ["eric", "test_data"]
def setUp(self):
self.client.login(username='eric', password='<PASSWORD>')
self.pip = Project.objects.get(slug='pip')
def test_valid_versions(s... | [
"projects.models.Project.objects.get",
"json.loads"
] | [((258, 289), 'projects.models.Project.objects.get', 'Project.objects.get', ([], {'slug': '"""pip"""'}), "(slug='pip')\n", (277, 289), False, 'from projects.models import Project\n'), ((410, 431), 'json.loads', 'json.loads', (['r.content'], {}), '(r.content)\n', (420, 431), False, 'import json\n'), ((691, 712), 'json.l... |
import pandas as pd
import numpy as np
import sys
from PIL import Image
import matplotlib.pyplot as plt
# progressInstalled = False
# try:
# from progress.bar import ChargingBar
# except:
# progressInstalled = False
sets = set(['a','b','c','d','e'])
def loadData(src,datasets= ['a','b','c','d','... | [
"matplotlib.pyplot.show",
"numpy.zeros",
"matplotlib.pyplot.axis",
"numpy.array",
"numpy.concatenate"
] | [((2063, 2093), 'numpy.concatenate', 'np.concatenate', (['inputs'], {'axis': '(0)'}), '(inputs, axis=0)\n', (2077, 2093), True, 'import numpy as np\n'), ((2104, 2135), 'numpy.concatenate', 'np.concatenate', (['outputs'], {'axis': '(0)'}), '(outputs, axis=0)\n', (2118, 2135), True, 'import numpy as np\n'), ((2191, 2206)... |
import os
def get_project_root() -> str:
project_path = os.path.join(__file__, "../../../../")
project_path = os.path.abspath(project_path)
return project_path
def get_robot_root() -> str:
project_path = os.path.join(__file__, "../../../")
project_path = os.path.abspath(project_path)
return ... | [
"os.path.abspath",
"os.path.join"
] | [((62, 100), 'os.path.join', 'os.path.join', (['__file__', '"""../../../../"""'], {}), "(__file__, '../../../../')\n", (74, 100), False, 'import os\n'), ((120, 149), 'os.path.abspath', 'os.path.abspath', (['project_path'], {}), '(project_path)\n', (135, 149), False, 'import os\n'), ((224, 259), 'os.path.join', 'os.path... |
import numpy as np
import DeepLearning.DataCenter.DataProcessing as data
class DataCenter():
''' A DataCenter object can be considered the hard-drive of the model. We use it to store any information or
data we need for deep learning Tasks:
Categories:
Data:
- Training Data
... | [
"numpy.load",
"numpy.nan_to_num",
"numpy.floor",
"DeepLearning.DataCenter.DataProcessing.balance_batch_for_dual_sided_one_hot",
"DeepLearning.DataCenter.DataProcessing.augment_add_noise",
"DeepLearning.DataCenter.DataProcessing.augment_1D_left_right",
"numpy.round",
"DeepLearning.DataCenter.DataProces... | [((3179, 3218), 'DeepLearning.DataCenter.DataProcessing.load_data', 'data.load_data', (['(data_folder + data_file)'], {}), '(data_folder + data_file)\n', (3193, 3218), True, 'import DeepLearning.DataCenter.DataProcessing as data\n'), ((3241, 3269), 'numpy.nan_to_num', 'np.nan_to_num', (['self.all_data'], {}), '(self.al... |
def _reset_sys_path():
# Clear generic sys.path[0]
import sys
import os
resources = os.environ["RESOURCEPATH"]
while sys.path[0] == resources:
del sys.path[0]
_reset_sys_path()
def _chdir_resource():
import os
os.chdir(os.environ["RESOURCEPATH"])
_chdir_resource()
def _disa... | [
"os.path.basename",
"ctypes.macholib.dyld.DEFAULT_LIBRARY_FALLBACK.insert",
"os.path.join",
"os.chdir",
"ctypes.macholib.dyld.DEFAULT_FRAMEWORK_FALLBACK.insert",
"re.compile"
] | [((560, 599), 're.compile', 're.compile', (["b'coding[:=]\\\\s*([-\\\\w.]+)'"], {}), "(b'coding[:=]\\\\s*([-\\\\w.]+)')\n", (570, 599), False, 'import re\n'), ((252, 288), 'os.chdir', 'os.chdir', (["os.environ['RESOURCEPATH']"], {}), "(os.environ['RESOURCEPATH'])\n", (260, 288), False, 'import os\n'), ((1068, 1108), 'o... |
# Copyright 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | [
"glanceclient.v2.metadefs.ResourceTypeController",
"tests.utils.FakeAPI",
"tests.utils.FakeSchemaAPI"
] | [((5663, 5691), 'tests.utils.FakeAPI', 'utils.FakeAPI', (['data_fixtures'], {}), '(data_fixtures)\n', (5676, 5691), False, 'from tests import utils\n'), ((5718, 5754), 'tests.utils.FakeSchemaAPI', 'utils.FakeSchemaAPI', (['schema_fixtures'], {}), '(schema_fixtures)\n', (5737, 5754), False, 'from tests import utils\n'),... |
from decimal import Decimal
from django.conf import settings
from django.core.mail import EmailMultiAlternatives
from django.template.loader import get_template
from helium.common.utils import metricutils
__author__ = "<NAME>"
__copyright__ = "Copyright 2021, Helium Edu"
__version__ = "1.4.46"
class HeliumError(Ex... | [
"django.core.mail.EmailMultiAlternatives",
"decimal.Decimal",
"helium.common.utils.metricutils.increment",
"django.template.loader.get_template"
] | [((861, 897), 'django.template.loader.get_template', 'get_template', (['f"""{template_name}.txt"""'], {}), "(f'{template_name}.txt')\n", (873, 897), False, 'from django.template.loader import get_template\n'), ((909, 946), 'django.template.loader.get_template', 'get_template', (['f"""{template_name}.html"""'], {}), "(f... |
import logging
import torch
from torch.nn.parallel import DistributedDataParallel
from basicsr.models.video_base_model import VideoBaseModel
logger = logging.getLogger('basicsr')
class EDVRModel(VideoBaseModel):
"""EDVR Model.
Paper: EDVR: Video Restoration with Enhanced Deformable Convolutional Networks. ... | [
"torch.optim.Adam",
"logging.getLogger"
] | [((152, 180), 'logging.getLogger', 'logging.getLogger', (['"""basicsr"""'], {}), "('basicsr')\n", (169, 180), False, 'import logging\n'), ((1597, 1651), 'torch.optim.Adam', 'torch.optim.Adam', (['optim_params'], {}), "(optim_params, **train_opt['optim_g'])\n", (1613, 1651), False, 'import torch\n')] |
from bokeh.models import Slider, Label, SingleIntervalTicker, NumeralTickFormatter,RadioButtonGroup, Div
from bokeh.plotting import ColumnDataSource, figure, output_file, show
from bokeh.layouts import column, row, layout
from bokeh.io import output_file, show, curdoc
import numpy as np
# import 2020 mortality tables
... | [
"bokeh.plotting.figure",
"bokeh.models.Slider",
"bokeh.models.Div",
"bokeh.models.SingleIntervalTicker",
"numpy.genfromtxt",
"numpy.around",
"bokeh.models.RadioButtonGroup",
"bokeh.models.NumeralTickFormatter",
"numpy.arange",
"bokeh.io.curdoc",
"bokeh.layouts.column",
"numpy.interp",
"numpy... | [((328, 398), 'numpy.genfromtxt', 'np.genfromtxt', (['"""CDC2017 life tables.csv"""'], {'delimiter': '""","""', 'skip_header': '(1)'}), "('CDC2017 life tables.csv', delimiter=',', skip_header=1)\n", (341, 398), True, 'import numpy as np\n'), ((2496, 2678), 'bokeh.plotting.figure', 'figure', ([], {'x_range': '(0, 100)',... |
# Generated by Django 3.0.6 on 2020-05-20 14:53
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Application',
fields=[
('id', models.AutoFi... | [
"django.db.models.CharField",
"django.db.models.AutoField"
] | [((307, 400), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (323, 400), False, 'from django.db import migrations, models\... |
import os
import platform
import unittest
from conans.model.info import ConanInfo
from conans.model.ref import ConanFileReference
from conans.paths import CONANFILE, CONANINFO, CONANENV
from conans.test.utils.tools import TestClient
from conans.test.utils.cpp_test_files import cpp_hello_conan_files
from conans.util.fi... | [
"conans.test.utils.cpp_test_files.cpp_hello_conan_files",
"conans.model.ref.ConanFileReference.loads",
"os.system",
"conans.tools.chdir",
"platform.system",
"conans.test.utils.tools.TestClient",
"os.path.join",
"os.listdir"
] | [((460, 472), 'conans.test.utils.tools.TestClient', 'TestClient', ([], {}), '()\n', (470, 472), False, 'from conans.test.utils.tools import TestClient\n'), ((1129, 1141), 'conans.test.utils.tools.TestClient', 'TestClient', ([], {}), '()\n', (1139, 1141), False, 'from conans.test.utils.tools import TestClient\n'), ((282... |
import torch
from survae.utils import sum_except_batch
from survae.distributions import ConditionalDistribution
from survae.transforms.surjections import Surjection
class Augment(Surjection):
'''
A simple augmentation layer which augments the input with additional elements.
This is useful for constructing... | [
"torch.split",
"torch.cat"
] | [((1153, 1206), 'torch.split', 'torch.split', (['z', 'split_proportions'], {'dim': 'self.split_dim'}), '(z, split_proportions, dim=self.split_dim)\n', (1164, 1206), False, 'import torch\n'), ((1419, 1457), 'torch.cat', 'torch.cat', (['[x, z2]'], {'dim': 'self.split_dim'}), '([x, z2], dim=self.split_dim)\n', (1428, 1457... |
import pytest
from io import BytesIO
from rest_framework.status import HTTP_200_OK, HTTP_204_NO_CONTENT, HTTP_400_BAD_REQUEST
from django.shortcuts import reverse
from django.core.exceptions import ValidationError
from faker import Faker
from baserow.core.handler import CoreHandler
from baserow.contrib.database.fi... | [
"baserow.contrib.database.fields.handler.FieldHandler",
"io.BytesIO",
"baserow.core.handler.CoreHandler",
"faker.Faker",
"baserow.contrib.database.views.handler.ViewHandler",
"baserow.contrib.database.rows.handler.RowHandler",
"pytest.raises",
"baserow.contrib.database.fields.models.SingleSelectField.... | [((1139, 1153), 'baserow.contrib.database.fields.handler.FieldHandler', 'FieldHandler', ([], {}), '()\n', (1151, 1153), False, 'from baserow.contrib.database.fields.handler import FieldHandler\n'), ((3352, 3366), 'baserow.contrib.database.fields.handler.FieldHandler', 'FieldHandler', ([], {}), '()\n', (3364, 3366), Fal... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.