code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from discord.ext import commands
import discord
import logging
class JobsBulletin(commands.Cog):
CHANNEL_NAME = "jobs-bulletin"
FAIR_WORK_INFO = "https://www.fairwork.gov.au/pay/unpaid-work/work-experience-and-internships"
EAIT_UNPAID_JOBS = "https://www.eait.uq.edu.au/engineering-professional-practice-unp... | [
"discord.ext.commands.Cog.listener",
"discord.AllowedMentions",
"discord.Embed"
] | [((2428, 2451), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (2449, 2451), False, 'from discord.ext import commands\n'), ((3194, 3209), 'discord.Embed', 'discord.Embed', ([], {}), '()\n', (3207, 3209), False, 'import discord\n'), ((3108, 3160), 'discord.AllowedMentions', 'discord.Allo... |
from typing import List, Tuple
import itertools
from django.core.cache import cache
from django.utils.translation import ugettext as _
from .language_manager import LanguageManager
class NumberToWords:
SPLIT_CHARS = ['-', '/']
SPLIT_DIGITS = ['0', '1']
DIGIT_TO_CHAR = {
'0': ['0'],
'1': ... | [
"django.utils.translation.ugettext",
"itertools.product",
"itertools.combinations"
] | [((1418, 1470), 'django.utils.translation.ugettext', '_', (['"""I am sorry, but this is too complicated for me."""'], {}), "('I am sorry, but this is too complicated for me.')\n", (1419, 1470), True, 'from django.utils.translation import ugettext as _\n'), ((2856, 2944), 'django.utils.translation.ugettext', '_', (['"""... |
"""
Code to load view entities in the background so they show up quickly when displayed.
"""
import pandas as pd
import asyncio
from asyncio import Task
from collections import deque
import warnings
from pathlib import Path
from typing import Union, Deque
from ramjet.analysis.viewer.view_entity import ViewEntity
from ... | [
"warnings.warn",
"collections.deque",
"ramjet.analysis.viewer.view_entity.ViewEntity.from_identifier_data_frame_row",
"pandas.read_csv"
] | [((726, 762), 'collections.deque', 'deque', ([], {'maxlen': 'self.maximum_preloaded'}), '(maxlen=self.maximum_preloaded)\n', (731, 762), False, 'from collections import deque\n'), ((824, 860), 'collections.deque', 'deque', ([], {'maxlen': 'self.maximum_preloaded'}), '(maxlen=self.maximum_preloaded)\n', (829, 860), Fals... |
#!/usr/bin/python
#-*- coding: utf-8 -*-
import os,sys
sys.path.append(os.path.split(os.path.realpath(__file__))[0])
| [
"os.path.realpath"
] | [((228, 254), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (244, 254), False, 'import os, sys\n')] |
import numpy as np
# 2 x 3
arr = np.linspace(1.1, 6.6, 6).reshape(2, 3)
print(arr)
arr = arr.astype('int')
print(arr) | [
"numpy.linspace"
] | [((35, 59), 'numpy.linspace', 'np.linspace', (['(1.1)', '(6.6)', '(6)'], {}), '(1.1, 6.6, 6)\n', (46, 59), True, 'import numpy as np\n')] |
#!/usr/bin/python
# this assumes you have the socks.py (http://phiral.net/socks.py)
# and terminal.py (http://phiral.net/terminal.py) in the
# same directory and that you have tor running locally
# on port 9050. run with 128 to 256 threads to be effective.
# kills apache 1.X with ~128, apache 2.X / IIS with ~256
# n... | [
"threading.Thread.__init__",
"socks.socksocket",
"getopt.getopt",
"random.choice",
"random.uniform",
"time.sleep",
"sys.exit",
"terminal.TerminalController",
"tkMessageBox.showinfo"
] | [((594, 623), 'terminal.TerminalController', 'terminal.TerminalController', ([], {}), '()\n', (621, 623), False, 'import terminal\n'), ((668, 728), 'tkMessageBox.showinfo', 'tkMessageBox.showinfo', (['"""ATTENTION!!!"""', '"""The target is seted"""'], {}), "('ATTENTION!!!', 'The target is seted')\n", (689, 728), False,... |
# Generated by Django 3.0.6 on 2021-01-19 06:47
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('apps', '0010_onsitemeeting_meno'),
]
operations = [
migrations.CreateModel(
name='GB',
... | [
"django.db.models.AutoField",
"django.db.models.IntegerField",
"django.db.models.SmallIntegerField",
"django.db.models.ForeignKey"
] | [((1008, 1100), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'on_delete': 'django.db.models.deletion.SET_NULL', 'to': '"""apps.GB"""'}), "(null=True, on_delete=django.db.models.deletion.SET_NULL,\n to='apps.GB')\n", (1025, 1100), False, 'from django.db import migrations, models\n'), ((... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 15 10:07:53 2016
@author: <NAME>
"""
import numpy as np
n_1 = 0.2
n_2 = 0.2
n_3 = 0.2
n_4 = 0.2
Ms_list = np.array([ 68.74, 75.71, 82.33, 84.77, 88.27])
Mf_list = np.array([ 57.74, 65.39, 71.29, 74.07, 77.88])
As_list = np.array([ 78.47, 83.82, 88.81, 91.38, 94.78])
Af... | [
"numpy.array"
] | [((157, 202), 'numpy.array', 'np.array', (['[68.74, 75.71, 82.33, 84.77, 88.27]'], {}), '([68.74, 75.71, 82.33, 84.77, 88.27])\n', (165, 202), True, 'import numpy as np\n'), ((214, 259), 'numpy.array', 'np.array', (['[57.74, 65.39, 71.29, 74.07, 77.88]'], {}), '([57.74, 65.39, 71.29, 74.07, 77.88])\n', (222, 259), True... |
from typing import Any
import numpy as np
from matplotlib import pyplot as plt
from time import perf_counter
from scipy import integrate
from .study_configuration import StudyConfiguration
class FatigueIntegrator:
def __init__(self, study_configuration: StudyConfiguration):
self.study = study_configurat... | [
"numpy.sqrt",
"matplotlib.pyplot.plot",
"time.perf_counter",
"numpy.sum",
"matplotlib.pyplot.axes",
"matplotlib.pyplot.show"
] | [((483, 493), 'matplotlib.pyplot.axes', 'plt.axes', ([], {}), '()\n', (491, 493), True, 'from matplotlib import pyplot as plt\n'), ((1356, 1366), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1364, 1366), True, 'from matplotlib import pyplot as plt\n'), ((2840, 2852), 'numpy.sqrt', 'np.sqrt', (['mse'], {}), ... |
from __future__ import division
from zibalzeep.xsd.const import xsd_ns
from zibalzeep.xsd.elements.base import Base
class Schema(Base):
name = "schema"
attr_name = "schema"
qname = xsd_ns("schema")
def clone(self, qname, min_occurs=1, max_occurs=1):
return self.__class__()
def parse_kwa... | [
"zibalzeep.xsd.schema.Schema",
"zibalzeep.xsd.const.xsd_ns"
] | [((196, 212), 'zibalzeep.xsd.const.xsd_ns', 'xsd_ns', (['"""schema"""'], {}), "('schema')\n", (202, 212), False, 'from zibalzeep.xsd.const import xsd_ns\n'), ((659, 697), 'zibalzeep.xsd.schema.Schema', '_Schema', (['xmlelement', 'schema._transport'], {}), '(xmlelement, schema._transport)\n', (666, 697), True, 'from zib... |
import subprocess
import os.path
import re
from enum import Enum
from .base import TerrawareDevice
UpsStatus = Enum('UpsStatus', 'online onbattery lowbattery unknown')
# We could use the existence of these files in init_ to decide we don't need to start the services if they're already running, but just in case they g... | [
"subprocess.run",
"re.match",
"enum.Enum"
] | [((112, 168), 'enum.Enum', 'Enum', (['"""UpsStatus"""', '"""online onbattery lowbattery unknown"""'], {}), "('UpsStatus', 'online onbattery lowbattery unknown')\n", (116, 168), False, 'from enum import Enum\n'), ((1182, 1261), 'subprocess.run', 'subprocess.run', (["['upsdrvctl', 'start', 'terrabrainups']"], {'stdout': ... |
################################################################################
# The Neural Network (NN) based Speech Synthesis System
# https://github.com/CSTR-Edinburgh/merlin
#
# Centre for Speech Technology Research
# University of Edinburgh, UK
# ... | [
"logging.getLogger",
"numpy.fromfile",
"numpy.log10",
"numpy.sqrt",
"numpy.log",
"multiprocessing.cpu_count",
"frontend.label_composer.LabelComposer",
"numpy.array",
"frontend.parameter_generation.ParameterGeneration",
"frontend.min_max_norm.MinMaxNormalisation",
"run_keras_with_merlin_io.KerasC... | [((4534, 4563), 'logging.getLogger', 'logging.getLogger', (['"""plotting"""'], {}), "('plotting')\n", (4551, 4563), False, 'import logging\n'), ((5721, 5741), 'io_funcs.binary_io.BinaryIOCollection', 'BinaryIOCollection', ([], {}), '()\n', (5739, 5741), False, 'from io_funcs.binary_io import BinaryIOCollection\n'), ((6... |
import sys
import ctypes_scanner
pidint = int(sys.argv[1])
toto = ctypes_scanner.GetRegexMatches(pidint,"http://[a-zA-Z_0-9\.]*")
print(toto)
print(len(toto))
| [
"ctypes_scanner.GetRegexMatches"
] | [((68, 133), 'ctypes_scanner.GetRegexMatches', 'ctypes_scanner.GetRegexMatches', (['pidint', '"""http://[a-zA-Z_0-9\\\\.]*"""'], {}), "(pidint, 'http://[a-zA-Z_0-9\\\\.]*')\n", (98, 133), False, 'import ctypes_scanner\n')] |
import discord
import json
# --- Embeds ---
async def Embed (_Client, _Title, _Content, _Color, _Channel):
Embed = discord.Embed (title = _Title, description = _Content, color = _Color)
await _Client.send_message (_Channel, embed = Embed)
async def LinkEmbed (_Client, _Title, _Content, _Link, _Color, _Chann... | [
"discord.Embed"
] | [((121, 184), 'discord.Embed', 'discord.Embed', ([], {'title': '_Title', 'description': '_Content', 'color': '_Color'}), '(title=_Title, description=_Content, color=_Color)\n', (134, 184), False, 'import discord\n'), ((337, 411), 'discord.Embed', 'discord.Embed', ([], {'title': '_Title', 'url': '_Link', 'description': ... |
# Imports
import torch
from itertools import count
from torch.autograd import Variable
from utils import *
import random
import numpy as np
USE_CUDA = torch.cuda.is_available()
dtype = torch.cuda.FloatTensor if torch.cuda.is_available() else torch.FloatTensor
device = torch.device("cuda" if torch.cuda.is_available()... | [
"numpy.abs",
"random.randrange",
"numpy.array",
"torch.tensor",
"torch.cuda.is_available",
"itertools.count",
"torch.save",
"random.random",
"torch.autograd.Variable",
"torch.cat"
] | [((154, 179), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (177, 179), False, 'import torch\n'), ((214, 239), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (237, 239), False, 'import torch\n'), ((3088, 3095), 'itertools.count', 'count', ([], {}), '()\n', (3093, 3095)... |
# -*- coding: UTF-8 -*-
# This file is a part of pycerberus.
# The source code contained in this file is licensed under the MIT license.
# See LICENSE.txt in the main project directory, for more information.
# SPDX-License-Identifier: MIT
from __future__ import absolute_import, print_function, unicode_literals
import... | [
"os.path.exists",
"pkg_resources.resource_filename",
"sys._getframe",
"os.path.normpath",
"os.path.abspath"
] | [((733, 772), 'pkg_resources.resource_filename', 'resource_filename', (['__name__', '"""/locales"""'], {}), "(__name__, '/locales')\n", (750, 772), False, 'from pkg_resources import resource_filename\n'), ((784, 817), 'os.path.exists', 'os.path.exists', (['locale_dir_in_egg'], {}), '(locale_dir_in_egg)\n', (798, 817), ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from marshmallow import fields
from polyaxon_schemas.base import BaseConfig, BaseMultiSchema, BaseSchema
class BaseRegularizerSchema(BaseSchema):
name = fields.Str(allow_none=True)
collect = fields.Bool(default=True, mi... | [
"marshmallow.fields.Bool",
"marshmallow.fields.Float",
"marshmallow.fields.Str"
] | [((250, 277), 'marshmallow.fields.Str', 'fields.Str', ([], {'allow_none': '(True)'}), '(allow_none=True)\n', (260, 277), False, 'from marshmallow import fields\n'), ((292, 331), 'marshmallow.fields.Bool', 'fields.Bool', ([], {'default': '(True)', 'missing': '(True)'}), '(default=True, missing=True)\n', (303, 331), Fals... |
"""Testing utilities for the MNE BIDS converter."""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import os.path as op
# This is here to handle mne-python <0.20
import warnings
from datetime import datetime
from pathlib import Path
import pytest
from nu... | [
"mne.io.read_raw_bti",
"mne_bids.utils._get_ch_type_mapping",
"mne.io.RawArray",
"datetime.datetime",
"mne_bids.BIDSPath",
"numpy.random.random",
"pathlib.Path",
"mne_bids.path._path_to_str",
"mne_bids.utils._age_on_date",
"mne.io.read_raw_brainvision",
"mne_bids.utils._check_types",
"os.path.... | [((943, 1032), 'mne_bids.BIDSPath', 'BIDSPath', ([], {'subject': 'subject_id', 'session': 'session_id', 'run': 'run', 'acquisition': 'acq', 'task': 'task'}), '(subject=subject_id, session=session_id, run=run, acquisition=acq,\n task=task)\n', (951, 1032), False, 'from mne_bids import BIDSPath\n'), ((351, 376), 'warn... |
import os
import json
import numpy as np
from experiment_handler.time_synchronisation import convert_timestamps
from experiment_handler.finder import find_all_imu_files
def load_imu_file(filepath):
lines = []
with open(filepath, 'r') as file:
try:
lines = file.read().split("\n")
ex... | [
"matplotlib.pyplot.imshow",
"experiment_handler.finder.find_all_imu_files",
"os.path.exists",
"json.loads",
"json.dump",
"os.path.join",
"experiment_handler.time_synchronisation.convert_timestamps",
"os.path.realpath",
"numpy.append",
"numpy.isnan",
"json.load",
"numpy.load",
"numpy.save",
... | [((4624, 4677), 'os.path.join', 'os.path.join', (['experiment_path', '"""imu"""', "(source + '.log')"], {}), "(experiment_path, 'imu', source + '.log')\n", (4636, 4677), False, 'import os\n'), ((8368, 8435), 'os.path.join', 'os.path.join', (['experiment_path', '"""imu"""', "(source + '_movement-data.npy')"], {}), "(exp... |
import os
import glob
import pickle
import re
# Our numerical workhorses
import numpy as np
import pandas as pd
# Import the project utils
import sys
sys.path.insert(0, '../')
import NB_sortseq_utils as utils
# Import matplotlib stuff for plotting
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from IPyth... | [
"pandas.isnull",
"sys.path.insert",
"seaborn.set_palette",
"matplotlib.patches.Rectangle",
"pandas.read_csv",
"numpy.arange",
"numpy.zeros",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.tight_layout",
"numpy.percentile",
"NB_sortseq_utils.set_plotting_style1",
"matplotlib.pyplot.legend"
] | [((152, 177), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../"""'], {}), "(0, '../')\n", (167, 177), False, 'import sys\n'), ((458, 499), 'seaborn.set_palette', 'sns.set_palette', (['"""deep"""'], {'color_codes': '(True)'}), "('deep', color_codes=True)\n", (473, 499), True, 'import seaborn as sns\n'), ((500, 527... |
import sys
sys.path.append('..')
from utils import *
class Cascade:
# --------------------------
# Initiate Cascade
# --------------------------
def __init__(self, root_tweet_id, cascade_path, label=None):
self.file_id = root_tweet_id # For label.txt
self.root_tweet_id = root_tw... | [
"networkx.drawing.nx_agraph.graphviz_layout",
"sys.path.append"
] | [((11, 32), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (26, 32), False, 'import sys\n'), ((2644, 2685), 'networkx.drawing.nx_agraph.graphviz_layout', 'graphviz_layout', (['G'], {'prog': '"""twopi"""', 'args': '""""""'}), "(G, prog='twopi', args='')\n", (2659, 2685), False, 'from networkx.draw... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
"testing.lite_types.Integers",
"testing.lite_types.Optionals",
"testing.lite_types.easy",
"testing.lite_types.UnusedError",
"testing.lite_types.OptionalFile",
"testing.lite_types.Reserved",
"thrift.py3lite.types.isset",
"thrift.py3lite.serializer.serialize_iobuf",
"thrift.py3lite.serializer.deserial... | [((1117, 1155), 'testing.lite_types.OptionalFile', 'OptionalFile', ([], {'name': '"""/dev/null"""', 'type': '(8)'}), "(name='/dev/null', type=8)\n", (1129, 1155), False, 'from testing.lite_types import Color, Integers, File, OptionalFile, Kind, Nested1, Nested2, Nested3, Optionals, Reserved, Runtime, UnusedError, easy,... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
恢复被删入回收站的内容
'''
import os
import optparse
from _winreg import *
def sid2user(sid):
try:
key = OpenKey(HKEY_LOCAL_MACHINE,
"SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
+ '\\' + sid)
(value, type) = QueryValueEx(key, 'ProfileImagePath')
... | [
"os.listdir",
"os.path.isdir"
] | [((621, 643), 'os.listdir', 'os.listdir', (['recycleDir'], {}), '(recycleDir)\n', (631, 643), False, 'import os\n'), ((513, 538), 'os.path.isdir', 'os.path.isdir', (['recycleDir'], {}), '(recycleDir)\n', (526, 538), False, 'import os\n'), ((678, 706), 'os.listdir', 'os.listdir', (['(recycleDir + sid)'], {}), '(recycleD... |
#!/usr/bin/env python
###############################################################################
#
# convdbpacked2ascii.py - Convert PTTableauPacked tableaux db to ASCII format
#
# File: convdbpacked2ascii.py
# Author: <NAME>
# Created: July 2008
#
#
# Usage:
# convdbpacked2ascii.py inputdb > outputfile
#
#... | [
"sys.stdout.write",
"sys.stderr.write",
"sys.exit"
] | [((1822, 1884), 'sys.stderr.write', 'sys.stderr.write', (["('Usage: ' + prog + ' inputdb > outputfile\\n')"], {}), "('Usage: ' + prog + ' inputdb > outputfile\\n')\n", (1838, 1884), False, 'import sys\n'), ((1889, 1900), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (1897, 1900), False, 'import sys\n'), ((2418, 2459)... |
#!/usr/bin/env python
# ******************************************************************************
# Copyright 2014-2018 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
... | [
"neon.layers.Affine",
"neon.transforms.Rectlin",
"neon.transforms.Misclassification",
"neon.transforms.Logistic",
"neon.optimizers.GradientDescentMomentum",
"neon.initializers.Gaussian",
"neon.layers.SingleOutputTree",
"neon.transforms.CrossEntropyBinary",
"neon.util.argparser.NeonArgparser",
"neo... | [((1775, 1797), 'neon.util.argparser.NeonArgparser', 'NeonArgparser', (['__doc__'], {}), '(__doc__)\n', (1788, 1797), False, 'from neon.util.argparser import NeonArgparser\n'), ((1866, 1891), 'neon.data.MNIST', 'MNIST', ([], {'path': 'args.data_dir'}), '(path=args.data_dir)\n', (1871, 1891), False, 'from neon.data impo... |
import time
import os
import pytest
import subprocess
import sys
import ray
from ray.rllib import _register_all
from ray.cluster_utils import Cluster
from ray.tune import register_trainable
from ray.tune.trial import Trial
from ray.tune.trial_runner import TrialRunner
from ray.tune.utils.mock import MockDurableTraine... | [
"os.listdir",
"ray.shutdown",
"ray.tune.register_trainable",
"os.path.join",
"time.sleep",
"pytest.main",
"pytest.mark.parametrize",
"os.path.dirname",
"ray.cluster_utils.Cluster",
"ray.tune.trial_runner.TrialRunner",
"ray.tune.trial_runner.TrialRunner.checkpoint_exists",
"ray.rllib._register_... | [((1127, 1197), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""searcher"""', "['hyperopt', 'skopt', 'bayesopt']"], {}), "('searcher', ['hyperopt', 'skopt', 'bayesopt'])\n", (1150, 1197), False, 'import pytest\n'), ((442, 571), 'ray.cluster_utils.Cluster', 'Cluster', ([], {'initialize_head': '(True)', 'conn... |
from unittest import TestCase
from mock import Mock, patch
from samcli.commands.local.lib.sam_base_provider import SamBaseProvider
from samcli.lib.intrinsic_resolver.intrinsic_property_resolver import IntrinsicResolver
class TestSamBaseProvider_get_template(TestCase):
@patch("samcli.commands.local.lib.sam_base_pr... | [
"mock.patch.object",
"samcli.commands.local.lib.sam_base_provider.SamBaseProvider.get_template",
"mock.patch",
"mock.Mock"
] | [((276, 355), 'mock.patch', 'patch', (['"""samcli.commands.local.lib.sam_base_provider.ResourceMetadataNormalizer"""'], {}), "('samcli.commands.local.lib.sam_base_provider.ResourceMetadataNormalizer')\n", (281, 355), False, 'from mock import Mock, patch\n'), ((361, 434), 'mock.patch', 'patch', (['"""samcli.commands.loc... |
#!/usr/bin/env python3
from __future__ import division, unicode_literals, print_function
from past.utils import old_div
import re
from util import hook, http
def human_price(x):
if x > 1e9:
return "{:,.2f}B".format(old_div(x, 1e9))
elif x > 1e6:
return "{:,.2f}M".format(old_div(x, 1e6))
... | [
"util.hook.api_key",
"os.getenv",
"past.utils.old_div"
] | [((350, 374), 'util.hook.api_key', 'hook.api_key', (['"""iexcloud"""'], {}), "('iexcloud')\n", (362, 374), False, 'from util import hook, http\n'), ((231, 255), 'past.utils.old_div', 'old_div', (['x', '(1000000000.0)'], {}), '(x, 1000000000.0)\n', (238, 255), False, 'from past.utils import old_div\n'), ((299, 320), 'pa... |
# Copyright 2015 Tesora Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | [
"re.escape",
"yaml.dump",
"ConfigParser.SafeConfigParser",
"trove.common.utils.unpack_singleton",
"six.add_metaclass",
"csv.writer",
"json.dumps",
"yaml.load",
"trove.common.xmltodict.unparse",
"trove.common.xmltodict.parse",
"ast.literal_eval",
"re.match",
"base64.b64decode",
"base64.b64e... | [((2371, 2401), 'six.add_metaclass', 'six.add_metaclass', (['abc.ABCMeta'], {}), '(abc.ABCMeta)\n', (2388, 2401), False, 'import six\n'), ((1343, 1375), 'trove.common.utils.is_collection', 'trove_utils.is_collection', (['items'], {}), '(items)\n', (1368, 1375), True, 'from trove.common import utils as trove_utils\n'), ... |
#!/usr/bin/python3
"""
This modules includes various executor classes. These can be used by Command,
or as templates to implement new executor classes.
"""
import os
import subprocess
def _execute_single(environment, **kwargs):
# pylint: disable=broad-except
try:
subprocess.check_call(env=environme... | [
"subprocess.check_call"
] | [((285, 333), 'subprocess.check_call', 'subprocess.check_call', ([], {'env': 'environment'}), '(env=environment, **kwargs)\n', (306, 333), False, 'import subprocess\n')] |
from airflow.providers.postgres.hooks.postgres import PostgresHook
from airflow.models.baseoperator import BaseOperator
from airflow.utils.decorators import apply_defaults
class RedshiftRunOperator(BaseOperator):
ui_color = '#F98866'
template_fields = ["sql"]
@apply_defaults
def __init__(self,
... | [
"airflow.providers.postgres.hooks.postgres.PostgresHook"
] | [((365, 389), 'airflow.providers.postgres.hooks.postgres.PostgresHook', 'PostgresHook', (['"""redshift"""'], {}), "('redshift')\n", (377, 389), False, 'from airflow.providers.postgres.hooks.postgres import PostgresHook\n')] |
"""
Publish coverage results online via coveralls.io.
Puts your coverage results on coveralls.io for everyone to see.
This tool makes custom reports for data generated by coverage.py package and
sends it to the coveralls.io service API.
All Python files in your coverage analysis are posted to this service along
with... | [
"logging.getLogger",
"logging.StreamHandler",
"docopt.docopt",
"sys.exit"
] | [((1558, 1588), 'logging.getLogger', 'logging.getLogger', (['"""coveralls"""'], {}), "('coveralls')\n", (1575, 1588), False, 'import logging\n'), ((1626, 1680), 'docopt.docopt', 'docopt.docopt', (['__doc__'], {'argv': 'argv', 'version': '__version__'}), '(__doc__, argv=argv, version=__version__)\n', (1639, 1680), False... |
__author__ = 'mnowotka'
from chembl_webresource_client.settings import Settings
from chembl_webresource_client.query import Query
from xml.dom.minidom import parseString
from urllib.parse import urlencode
from urllib.parse import quote
import logging
import mimetypes
from chembl_webresource_client.cache import monkey... | [
"logging.getLogger",
"mimetypes.init",
"urllib.parse.quote",
"mimetypes.add_type",
"chembl_webresource_client.cache.monkeypatch_requests_cache",
"xml.dom.minidom.parseString",
"chembl_webresource_client.settings.Settings.Instance",
"chembl_webresource_client.http_errors.handle_http_error"
] | [((410, 426), 'mimetypes.init', 'mimetypes.init', ([], {}), '()\n', (424, 426), False, 'import mimetypes\n'), ((427, 474), 'mimetypes.add_type', 'mimetypes.add_type', (['"""application/json"""', '""".json"""'], {}), "('application/json', '.json')\n", (445, 474), False, 'import mimetypes\n'), ((475, 503), 'chembl_webres... |
import Gradient_Descent_Solver_with_Numpy as GDSnp
import numpy as np
import sys
# #############################################################################
# Setup
it = [x/10 for x in list(range(10))]
X = [[x**0, x**1, x**2] for x in it]
wa = [4.0, 0.1, 0.2] # [[4.0], [0.1], [0.2]] with numpy
def Y_maker(X, w)... | [
"Gradient_Descent_Solver_with_Numpy.Gradient_Descent_Solver_with_Numpy"
] | [((543, 593), 'Gradient_Descent_Solver_with_Numpy.Gradient_Descent_Solver_with_Numpy', 'GDSnp.Gradient_Descent_Solver_with_Numpy', (['X', 'Y', 'LR'], {}), '(X, Y, LR)\n', (583, 593), True, 'import Gradient_Descent_Solver_with_Numpy as GDSnp\n')] |
#!/usr/bin/env python3
#coding:utf8
import redis
maxCount=50
def delSet(key):
count=bak.scard(key)
if count<maxCount:
mast.delete(key)
else:
for i in range(count):
mast.spop(key)
mast.delete(key)
print("set:"+key)
def delString(key):
mast.delete(key)
print("st... | [
"redis.ConnectionPool",
"redis.Redis"
] | [((1730, 1766), 'redis.Redis', 'redis.Redis', ([], {'connection_pool': 'bakPool'}), '(connection_pool=bakPool)\n', (1741, 1766), False, 'import redis\n'), ((1772, 1809), 'redis.Redis', 'redis.Redis', ([], {'connection_pool': 'mastPool'}), '(connection_pool=mastPool)\n', (1783, 1809), False, 'import redis\n'), ((1444, 1... |
import graphene
from ..core.fields import FilterInputConnectionField
from ..translations.mutations import AttributeTranslate, AttributeValueTranslate
from .bulk_mutations import AttributeBulkDelete, AttributeValueBulkDelete
from .filters import AttributeFilterInput
from .mutations import (
AttributeCreate,
Att... | [
"graphene.Argument",
"graphene.Node.get_node_from_global_id"
] | [((1304, 1362), 'graphene.Node.get_node_from_global_id', 'graphene.Node.get_node_from_global_id', (['info', 'id', 'Attribute'], {}), '(info, id, Attribute)\n', (1341, 1362), False, 'import graphene\n'), ((982, 1068), 'graphene.Argument', 'graphene.Argument', (['graphene.ID'], {'description': '"""ID of the attribute."""... |
# -*- coding: utf-8 -*-
import numpy as np
import random
import sys
from collections import Counter
import json
from argparse import ArgumentParser
from json_utils import load_json_file, load_json_stream
def get_leaves(node, leaves):
if node["left"] is not None:
get_leaves(node["left"], leaves)
g... | [
"numpy.copy",
"json_utils.load_json_file",
"numpy.sqrt",
"numpy.ones",
"argparse.ArgumentParser",
"json.dumps",
"numpy.array",
"numpy.argmin"
] | [((644, 657), 'numpy.copy', 'np.copy', (['dmat'], {}), '(dmat)\n', (651, 657), True, 'import numpy as np\n'), ((4205, 4221), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (4219, 4221), False, 'from argparse import ArgumentParser\n'), ((4552, 4577), 'json_utils.load_json_file', 'load_json_file', (['args... |
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.optimizers import SGD
# 生成虚拟数据
import numpy as np
# 1000行 20列
x_train = np.random.random((10000, 20))
# [0,10) 整数
y_train = keras.utils.to_categorical(np.random.randint(10, size=(10000, 1)), num_classes=10)... | [
"numpy.random.random",
"keras.models.Sequential",
"numpy.random.randint",
"keras.optimizers.SGD",
"keras.layers.Dense",
"keras.layers.Dropout"
] | [((186, 215), 'numpy.random.random', 'np.random.random', (['(10000, 20)'], {}), '((10000, 20))\n', (202, 215), True, 'import numpy as np\n'), ((330, 358), 'numpy.random.random', 'np.random.random', (['(1000, 20)'], {}), '((1000, 20))\n', (346, 358), True, 'import numpy as np\n'), ((459, 471), 'keras.models.Sequential',... |
import time
from draughtcraft.lib.minify import FileSystemResourceCache
# Server Specific Configurations
server = {
'port': '8080',
'host': '0.0.0.0'
}
# Pecan Application Configurations
app = {
'root': 'draughtcraft.controllers.root.RootController',
'modules': ['draughtcraft'],
'static_root': '... | [
"time.time"
] | [((474, 485), 'time.time', 'time.time', ([], {}), '()\n', (483, 485), False, 'import time\n')] |
import cv2 as cv
img1 = cv.imread(r'C:\Users\harrizazham98\Desktop\OpenCVForPython\resources\Day 2\final_galaxy.jpg')
img2 = cv.imread(r'C:\Users\harrizazham98\Desktop\OpenCVForPython\resources\Day 2\harry_potter.jpg')
img_2_shape = img2.shape
roi = img1[0:img_2_shape[0],0:img_2_shape[1]]
img2gray = cv.cvtColo... | [
"cv2.threshold",
"cv2.bitwise_and",
"cv2.imshow",
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.cvtColor",
"cv2.bitwise_not",
"cv2.imread",
"cv2.namedWindow",
"cv2.add"
] | [((27, 136), 'cv2.imread', 'cv.imread', (['"""C:\\\\Users\\\\harrizazham98\\\\Desktop\\\\OpenCVForPython\\\\resources\\\\Day 2\\\\final_galaxy.jpg"""'], {}), "(\n 'C:\\\\Users\\\\harrizazham98\\\\Desktop\\\\OpenCVForPython\\\\resources\\\\Day 2\\\\final_galaxy.jpg'\n )\n", (36, 136), True, 'import cv2 as cv\n'), ... |
"""Genericize queries -> views, where queries are one type of view.
Revision ID: 5fecf4bf9ca5
Revises: <PASSWORD>
Create Date: 2021-09-21 15:09:46.921356
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = "<KEY>"
down_revision ... | [
"sqlalchemy.dialects.mysql.BIGINT",
"sqlalchemy.ForeignKeyConstraint",
"sqlalchemy.dialects.mysql.TEXT",
"alembic.op.drop_table",
"sqlalchemy.dialects.mysql.VARCHAR",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.UniqueConstraint",
"sqlalchemy.String",
"alembic.op.drop_index",
"sqlalchemy.Enum",
... | [((1435, 1484), 'alembic.op.drop_index', 'op.drop_index', (['"""project_id"""'], {'table_name': '"""queries"""'}), "('project_id', table_name='queries')\n", (1448, 1484), False, 'from alembic import op\n'), ((1489, 1513), 'alembic.op.drop_table', 'op.drop_table', (['"""queries"""'], {}), "('queries')\n", (1502, 1513), ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
"""
Miscellaneous functions go here
"""
from __future__ import annotations
from meerschaum.utils.typing import (
Union, Mapping, Any, Callable, Optional, List, Dict, SuccessTuple, Iterable, PipesDict
)
def add_method_to_class(
func : Callable... | [
"re.compile",
"meerschaum.config.get_config",
"inspect.signature",
"secrets.choice",
"meerschaum.utils.warnings.warn",
"signal.alarm",
"sys.exit",
"datetime.timedelta",
"os.walk",
"re.search",
"meerschaum.get_connector",
"meerschaum.utils.packages.attempt_import",
"pathlib.Path",
"functool... | [((851, 862), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (856, 862), False, 'from functools import wraps, partial\n'), ((8747, 8760), 'meerschaum.utils.packages.import_rich', 'import_rich', ([], {}), '()\n', (8758, 8760), False, 'from meerschaum.utils.packages import import_rich\n'), ((8999, 9029), 'meersc... |
import math
import statistics
# math.prod - retorna o produto de um container numérico
nuns_v1 = [2, 3, 6, 8]
nuns_v2 = (2, 3, 6, 8)
nuns_v3 = {2, 3, 6, 8}
print(math.prod(nuns_v1))
print(math.prod(nuns_v2))
print(math.prod(nuns_v3))
# math.isqrt - retorna o valor da raiaz quadrada inteira
print(mat... | [
"math.dist",
"statistics.fmean",
"math.sqrt",
"math.isqrt",
"math.hypot",
"statistics.multimode",
"math.prod"
] | [((172, 190), 'math.prod', 'math.prod', (['nuns_v1'], {}), '(nuns_v1)\n', (181, 190), False, 'import math\n'), ((199, 217), 'math.prod', 'math.prod', (['nuns_v2'], {}), '(nuns_v2)\n', (208, 217), False, 'import math\n'), ((226, 244), 'math.prod', 'math.prod', (['nuns_v3'], {}), '(nuns_v3)\n', (235, 244), False, 'import... |
# Copyright (c) 2017, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
# external
from lxml import etree
import mixbox.xml
from mixbox.fields import TypedField
from mixbox.vendor.six import BytesIO, iteritems
# internal
import stix
from stix.indicator.test_mechanism import _BaseTestMe... | [
"lxml.etree.register_namespace",
"mixbox.vendor.six.iteritems",
"mixbox.fields.TypedField",
"lxml.etree.QName",
"mixbox.vendor.six.BytesIO"
] | [((806, 823), 'mixbox.fields.TypedField', 'TypedField', (['"""ioc"""'], {}), "('ioc')\n", (816, 823), False, 'from mixbox.fields import TypedField\n'), ((1384, 1405), 'mixbox.vendor.six.iteritems', 'iteritems', (['node.nsmap'], {}), '(node.nsmap)\n', (1393, 1405), False, 'from mixbox.vendor.six import BytesIO, iteritem... |
import itertools
from runtests.mpi import MPITest
import pybnb
from .common import mpi_available
def left_child(i):
return 2 * i + 1
def right_child(i):
return 2 * i + 2
def log2floor(n):
assert n > 0
return n.bit_length() - 1
def height(size):
return log2floor(size)
def set_none(heap, ... | [
"itertools.combinations",
"pybnb.Node",
"runtests.mpi.MPITest",
"pybnb.Solver"
] | [((5193, 5216), 'pybnb.Solver', 'pybnb.Solver', ([], {'comm': 'comm'}), '(comm=comm)\n', (5205, 5216), False, 'import pybnb\n'), ((8156, 8183), 'runtests.mpi.MPITest', 'MPITest', ([], {'commsize': '[1, 2, 4]'}), '(commsize=[1, 2, 4])\n', (8163, 8183), False, 'from runtests.mpi import MPITest\n'), ((1188, 1216), 'iterto... |
from typing import Dict, Tuple
from gym.envs.registration import register
import numpy as np
from highway_env import utils
from highway_env.envs.common.abstract import AbstractEnv, MultiAgentWrapper
from highway_env.road.lane import LineType, StraightLane, CircularLane, AbstractLane
from highway_env.road.regulation i... | [
"highway_env.road.regulation.RegulatedRoad",
"highway_env.road.road.RoadNetwork",
"numpy.radians",
"numpy.flip",
"numpy.linalg.norm",
"highway_env.utils.lmap",
"highway_env.utils.class_from_path",
"numpy.array",
"highway_env.road.lane.StraightLane",
"numpy.linspace",
"numpy.cos",
"highway_env.... | [((12436, 12480), 'highway_env.envs.common.abstract.MultiAgentWrapper', 'MultiAgentWrapper', (['MultiAgentIntersectionEnv'], {}), '(MultiAgentIntersectionEnv)\n', (12453, 12480), False, 'from highway_env.envs.common.abstract import AbstractEnv, MultiAgentWrapper\n'), ((12483, 12561), 'gym.envs.registration.register', '... |
# Generated by Django 2.0.2 on 2018-07-19 04:53
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('user_app', '0008_auto_20... | [
"django.db.models.OneToOneField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.migrations.swappable_dependency",
"django.db.migrations.RenameField"
] | [((227, 284), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (258, 284), False, 'from django.db import migrations, models\n'), ((797, 889), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name... |
# pylint: skip-file
# type: ignore
# -*- coding: utf-8 -*-
#
# tests.models.programdb.design_electric.design_electric_unit_test.py is part of
# The RAMSTK
# Project
#
# All rights reserved.
# Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com
"""Test class for testi... | [
"pytest.approx",
"pytest.mark.skip",
"pytest.mark.usefixtures",
"pubsub.pub.isSubscribed"
] | [((759, 828), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""test_record_model"""', '"""unit_test_table_model"""'], {}), "('test_record_model', 'unit_test_table_model')\n", (782, 828), False, 'import pytest\n'), ((6771, 6838), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""test_attributes"""',... |
import os
import sys
import time
import pathlib
import json
import logging
import traceback
import requests
import argparse
import threading
import queue
from fastapi.testclient import TestClient
from urllib.parse import urlencode
from main import app
afscreener_url = os.environ.get(
"AF_URL", "")
afscreener_tok... | [
"time.sleep",
"sys.exit",
"urllib.parse.urlencode",
"logging.info",
"logging.error",
"threading.Thread.__init__",
"os.path.exists",
"argparse.ArgumentParser",
"pathlib.Path",
"threading.Lock",
"json.dumps",
"time.perf_counter",
"json.loads",
"requests.get",
"logging.basicConfig",
"trac... | [((272, 300), 'os.environ.get', 'os.environ.get', (['"""AF_URL"""', '""""""'], {}), "('AF_URL', '')\n", (286, 300), False, 'import os\n'), ((325, 355), 'os.environ.get', 'os.environ.get', (['"""AF_TOKEN"""', '""""""'], {}), "('AF_TOKEN', '')\n", (339, 355), False, 'import os\n'), ((404, 419), 'fastapi.testclient.TestCl... |
import json, geojson, requests
import random, os, sys, shutil
import GeodesignHub, ShapelyHelper, config
from shapely.geometry.base import BaseGeometry
from shapely.geometry import shape, mapping, shape, asShape
from shapely.geometry import MultiPolygon, MultiPoint, MultiLineString
from shapely.ops import unary_union
f... | [
"zipfile.ZipFile",
"re.compile",
"os.path.exists",
"os.listdir",
"json.dumps",
"os.path.isdir",
"os.mkdir",
"fiona.open",
"os.unlink",
"re.match",
"os.path.splitext",
"requests.get",
"os.path.isfile",
"ShapelyHelper.export_to_JSON",
"urllib.parse.urlparse",
"os.path.join",
"os.getcwd... | [((5180, 5399), 're.compile', 're.compile', (['"""^(?:http|ftp)s?://(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\\\\.)+(?:[A-Z]{2,6}\\\\.?|[A-Z0-9-]{2,}\\\\.?)|localhost|\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3})(?::\\\\d+)?(?:/?|[/?]\\\\S+)$"""', 're.IGNORECASE'], {}), "(\n '^(?:http|ftp)s?://(?:(?:[A-Z... |
# Copyright (C) 2014, Red Hat, 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 applicable law or... | [
"oslo_utils.versionutils.convert_version_to_tuple",
"nova.db.virtual_interface_get_by_instance_and_network",
"nova.objects.fields.IntegerField",
"nova.db.virtual_interface_create",
"nova.db.virtual_interface_delete_by_instance",
"nova.objects.fields.ListOfObjectsField",
"nova.objects.fields.StringField"... | [((1083, 1104), 'nova.objects.fields.IntegerField', 'fields.IntegerField', ([], {}), '()\n', (1102, 1104), False, 'from nova.objects import fields\n'), ((1125, 1158), 'nova.objects.fields.StringField', 'fields.StringField', ([], {'nullable': '(True)'}), '(nullable=True)\n', (1143, 1158), False, 'from nova.objects impor... |
"""
Implements Genetic algorithms for black-box optimisation.
--<EMAIL>
"""
# pylint: disable=invalid-name
# pylint: disable=no-member
from argparse import Namespace
from numpy.random import choice
# Local imports
from .blackbox_optimiser import BlackboxOptimiser, blackbox_opt_args
from ..utils.general_utils impo... | [
"numpy.random.choice",
"argparse.Namespace"
] | [((6471, 6491), 'argparse.Namespace', 'Namespace', ([], {'point': 'ret'}), '(point=ret)\n', (6480, 6491), False, 'from argparse import Namespace\n'), ((7612, 7691), 'numpy.random.choice', 'choice', (['all_prev_eval_points', 'self.num_candidates_to_mutate_from'], {'replace': '(False)'}), '(all_prev_eval_points, self.num... |
"""This module implements an operator that logs bounding boxes."""
import json
import os
import erdos
class BoundingBoxLoggerOperator(erdos.Operator):
"""Logs bounding boxes of obstacles to files.
Args:
obstacles_stream (:py:class:`erdos.ReadStream`): The stream on which
:py:class:`~pylo... | [
"os.makedirs",
"os.path.join",
"erdos.WriteStream",
"erdos.utils.setup_logging",
"json.dump"
] | [((966, 1036), 'erdos.utils.setup_logging', 'erdos.utils.setup_logging', (['self.config.name', 'self.config.log_file_name'], {}), '(self.config.name, self.config.log_file_name)\n', (991, 1036), False, 'import erdos\n'), ((1166, 1211), 'os.path.join', 'os.path.join', (['self._flags.data_path', '"""bboxes"""'], {}), "(se... |
"""YuYuYu Churutto script""" # noqa
from __future__ import annotations
__author__ = 'Vardë'
import G41Fun as gf
import havsfunc as hvf
import lvsfunc as lvf
import vardefunc as vdf
import xvs
from vardautomation import FileInfo, PresetEAC3, PresetWEB
from vsutil import depth, get_y
from churutto_common import Encod... | [
"vsutil.get_y",
"G41Fun.MaskedDHA",
"havsfunc.SMDegrain",
"vardautomation.FileInfo",
"vardefunc.misc.merge_chroma",
"havsfunc.EdgeCleaner",
"lvsfunc.mask.detail_mask",
"vsutil.depth",
"xvs.WarpFixChromaBlend",
"vardefunc.deband.dumb3kdb"
] | [((399, 544), 'vardautomation.FileInfo', 'FileInfo', (['f"""{NUM}/Yuuki Yuuna wa Yuusha de Aru Churutto! - {NUM} (Amazon Prime VBR 1080p).mkv"""', '(24)', '(-22)'], {'preset': '[PresetWEB, PresetEAC3]'}), "(\n f'{NUM}/Yuuki Yuuna wa Yuusha de Aru Churutto! - {NUM} (Amazon Prime VBR 1080p).mkv'\n , 24, -22, preset... |
import pytest
from chess.board import Board
def test_board_init_play_white(start_board):
assert start_board.player_white is True
assert start_board.white_to_move is True
assert start_board.moves == []
def test_board_to_array_white(start_board, game_grid_white):
assert start_board.to_array() == gam... | [
"chess.board.Board"
] | [((448, 473), 'chess.board.Board', 'Board', ([], {'player_white': '(False)'}), '(player_white=False)\n', (453, 473), False, 'from chess.board import Board\n'), ((1105, 1167), 'chess.board.Board', 'Board', ([], {'player_white': '(True)', 'array': 'test_board', 'white_to_move': '(True)'}), '(player_white=True, array=test... |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
"unique_name.generate",
"numpy.dtype",
"collections.OrderedDict",
"re.compile"
] | [((1534, 1552), 'numpy.dtype', 'np.dtype', (['np_dtype'], {}), '(np_dtype)\n', (1542, 1552), True, 'import numpy as np\n'), ((21927, 21952), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (21950, 21952), False, 'import collections\n'), ((22075, 22100), 'collections.OrderedDict', 'collections.Or... |
from django.contrib import admin
from .models import accessKeyIDPW
admin.site.register(accessKeyIDPW)
| [
"django.contrib.admin.site.register"
] | [((68, 102), 'django.contrib.admin.site.register', 'admin.site.register', (['accessKeyIDPW'], {}), '(accessKeyIDPW)\n', (87, 102), False, 'from django.contrib import admin\n')] |
import libyang
from jinja2 import Template
import unittest
import yangvoodoo
import yangvoodoo.stublydal
"""
This set of unit tests uses the stub backend datastore, which is not preseeded with
any data.
"""
class test_new(unittest.TestCase):
def setUp(self):
self.maxDiff = None
self.stub = yangv... | [
"yangvoodoo.DataAccess",
"yangvoodoo.stublydal.StubLyDataAbstractionLayer"
] | [((315, 364), 'yangvoodoo.stublydal.StubLyDataAbstractionLayer', 'yangvoodoo.stublydal.StubLyDataAbstractionLayer', ([], {}), '()\n', (362, 364), False, 'import yangvoodoo\n'), ((388, 463), 'yangvoodoo.DataAccess', 'yangvoodoo.DataAccess', ([], {'data_abstraction_layer': 'self.stub', 'disable_proxy': '(True)'}), '(data... |
#!/bin/python3
"""
Script that updates the bars/splits/dividends/fundamentals cache
"""
import argparse
import logging
import os
import psycopg2
import atpy.data.iqfeed.util as iqutil
from atpy.data.cache.postgres_cache import insert_df_json, create_json_data
from atpy.data.iqfeed.iqfeed_level_1_provider import get_... | [
"logging.basicConfig",
"psycopg2.connect",
"argparse.ArgumentParser",
"atpy.data.cache.postgres_cache.insert_df_json",
"atpy.data.iqfeed.util.get_symbols",
"atpy.data.cache.postgres_cache.create_json_data.format",
"pyevents.events.SyncListeners",
"atpy.data.iqfeed.iqfeed_level_1_provider.get_splits_di... | [((433, 472), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (452, 472), False, 'import logging\n'), ((487, 561), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PostgreSQL and IQFeed configuration"""'}), "(description='PostgreSQL ... |
"""Tests for module `petibmpy.grid`."""
import copy
import numpy
import pathlib
import unittest
import petibmpy
class GridIOTestCase(unittest.TestCase):
"""Tests related to the I/O grid."""
def setUp(self):
"""Setup."""
self.x = numpy.sort(numpy.random.rand(5))
self.y = numpy.sort(n... | [
"petibmpy.Segment",
"petibmpy.read_grid_hdf5",
"numpy.allclose",
"numpy.random.rand",
"pathlib.Path",
"numpy.linspace",
"petibmpy.GridLine",
"petibmpy.write_grid_hdf5",
"petibmpy.CartesianGrid",
"copy.deepcopy"
] | [((504, 527), 'pathlib.Path', 'pathlib.Path', (['"""grid.h5"""'], {}), "('grid.h5')\n", (516, 527), False, 'import pathlib\n'), ((1307, 1338), 'petibmpy.Segment', 'petibmpy.Segment', ([], {'config': 'config'}), '(config=config)\n', (1323, 1338), False, 'import petibmpy\n'), ((1515, 1550), 'numpy.linspace', 'numpy.linsp... |
# -*- coding: utf-8 -*-#
'''
# Name: lDataNormalization
# Description:
# Author: super
# Date: 2020/5/13
'''
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from HelperClass.NeuralNet_1_1 import *
file_name = "../data/ch05.npz"
def ShowResult(net, r... | [
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.linspace",
"numpy.meshgrid",
"mpl_toolkits.mplot3d.Axes3D",
"matplotlib.pyplot.show"
] | [((404, 416), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (414, 416), True, 'import matplotlib.pyplot as plt\n'), ((426, 437), 'mpl_toolkits.mplot3d.Axes3D', 'Axes3D', (['fig'], {}), '(fig)\n', (432, 437), False, 'from mpl_toolkits.mplot3d import Axes3D\n'), ((1091, 1108), 'numpy.linspace', 'np.linspace... |
from sympy.core.singleton import S
from sympy.physics.vector import Vector, ReferenceFrame, Dyadic
from sympy.testing.pytest import raises
Vector.simp = True
A = ReferenceFrame('A')
def test_output_type():
A = ReferenceFrame('A')
v = A.x + A.y
d = v | v
zerov = Vector(0)
zerod = Dyadic(0)
# ... | [
"sympy.testing.pytest.raises",
"sympy.physics.vector.ReferenceFrame",
"sympy.physics.vector.Dyadic",
"sympy.physics.vector.Vector"
] | [((163, 182), 'sympy.physics.vector.ReferenceFrame', 'ReferenceFrame', (['"""A"""'], {}), "('A')\n", (177, 182), False, 'from sympy.physics.vector import Vector, ReferenceFrame, Dyadic\n'), ((217, 236), 'sympy.physics.vector.ReferenceFrame', 'ReferenceFrame', (['"""A"""'], {}), "('A')\n", (231, 236), False, 'from sympy... |
#!/usr/bin/env python3
# ****************************************************************************
# Copyright 2019 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy... | [
"sys.path.append",
"importlib.import_module",
"os.path.split"
] | [((973, 1018), 'sys.path.append', 'sys.path.append', (["(CYBER_PATH + '/third_party/')"], {}), "(CYBER_PATH + '/third_party/')\n", (988, 1018), False, 'import sys\n'), ((1019, 1056), 'sys.path.append', 'sys.path.append', (["(CYBER_PATH + '/lib/')"], {}), "(CYBER_PATH + '/lib/')\n", (1034, 1056), False, 'import sys\n'),... |
# DO NOT EDIT THIS FILE!
#
# This file is generated from the CDP specification. If you need to make
# changes, edit the generator and regenerate all of the modules.
#
# CDP domain: Profiler
from __future__ import annotations
from cdp.util import event_class, T_JSON_DICT
from dataclasses import dataclass
import enum
im... | [
"cdp.util.event_class"
] | [((13996, 14042), 'cdp.util.event_class', 'event_class', (['"""Profiler.consoleProfileFinished"""'], {}), "('Profiler.consoleProfileFinished')\n", (14007, 14042), False, 'from cdp.util import event_class, T_JSON_DICT\n'), ((14631, 14676), 'cdp.util.event_class', 'event_class', (['"""Profiler.consoleProfileStarted"""'],... |
#!/usr/bin/env python
"""Remote access utilities, via ssh & scp."""
from __future__ import print_function
import optparse
import os
import re
import shlex
import sys
import time
# The subprocess32 module is untested on Windows and thus isn't recommended for use, even when it's
# installed. See https://github.com/go... | [
"optparse.OptionGroup",
"shlex.split",
"subprocess.Popen",
"optparse.OptionParser",
"time.sleep",
"os.path.isdir",
"sys.exit",
"warnings.warn",
"os.path.abspath"
] | [((7031, 7073), 'optparse.OptionParser', 'optparse.OptionParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (7052, 7073), False, 'import optparse\n'), ((7096, 7143), 'optparse.OptionGroup', 'optparse.OptionGroup', (['parser', '"""Control options"""'], {}), "(parser, 'Control options')\n", (7116, 7143... |
#!/usr/bin/env python
"""
Convert a HDF5 storm-analysis format file to an Insight3 format bin file.
If the HDF5 file has been tracked the Insight3 file will be created from
the tracks. Note however that in the converted Insight3 file all the
localizations will be in frame 1.
If the HDF5 file has not been tracked the... | [
"xml.etree.ElementTree.fromstring",
"argparse.ArgumentParser",
"xml.etree.ElementTree.tostring",
"xml.etree.ElementTree.Element",
"storm_analysis.sa_library.sa_h5py.SAH5Reader",
"storm_analysis.sa_library.writeinsight3.I3Writer",
"xml.etree.ElementTree.SubElement"
] | [((2172, 2238), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""HDF5 to Insight3 converter."""'}), "(description='HDF5 to Insight3 converter.')\n", (2195, 2238), False, 'import argparse\n'), ((647, 675), 'storm_analysis.sa_library.sa_h5py.SAH5Reader', 'saH5Py.SAH5Reader', (['hdf5_name'], ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import gdspy
import picwriter.toolkit as tk
class Ring(tk.Component):
""" Ring Resonator Cell class.
Args:
* **wgt** (WaveguideTemplate): WaveguideTemplate object
... | [
"numpy.sin",
"picwriter.toolkit.add",
"gdspy.write_gds",
"numpy.cos",
"gdspy.Cell",
"gdspy.Path"
] | [((17612, 17629), 'gdspy.Cell', 'gdspy.Cell', (['"""top"""'], {}), "('top')\n", (17622, 17629), False, 'import gdspy\n'), ((17748, 17764), 'picwriter.toolkit.add', 'tk.add', (['top', 'wg1'], {}), '(top, wg1)\n', (17754, 17764), True, 'import picwriter.toolkit as tk\n'), ((17857, 17872), 'picwriter.toolkit.add', 'tk.add... |
from rest_framework import status
from django.test import TestCase, override_settings
from django.urls import reverse
from oems.settings import TEST_MEDIA_ROOT
from api import models
from front import forms
from front.tests import utils
@override_settings(MEDIA_ROOT=TEST_MEDIA_ROOT)
class MathematicalObjectCreationTe... | [
"front.tests.utils.create_function",
"front.tests.utils.create_mathematical_object",
"front.tests.utils.create_name",
"front.tests.utils.log_as",
"api.models.MathematicalObject.objects.count",
"api.models.MathematicalObject.objects.all",
"django.test.override_settings",
"django.urls.reverse",
"front... | [((240, 285), 'django.test.override_settings', 'override_settings', ([], {'MEDIA_ROOT': 'TEST_MEDIA_ROOT'}), '(MEDIA_ROOT=TEST_MEDIA_ROOT)\n', (257, 285), False, 'from django.test import TestCase, override_settings\n'), ((407, 447), 'front.tests.utils.log_as', 'utils.log_as', (['self', 'utils.UserType.STAFF'], {}), '(s... |
import FWCore.ParameterSet.Config as cms
tccFlatToDigi = cms.EDProducer("EcalFEtoDigi",
FileEventOffset = cms.untracked.int32(0),
UseIdentityLUT = cms.untracked.bool(False),
SuperModuleId = cms.untracked.int32(-1),
debugPrintFlag = cms.untracked.bool(False),
FlatBaseName = cms.untracked.string('eca... | [
"FWCore.ParameterSet.Config.untracked.int32",
"FWCore.ParameterSet.Config.untracked.string",
"FWCore.ParameterSet.Config.untracked.bool"
] | [((111, 133), 'FWCore.ParameterSet.Config.untracked.int32', 'cms.untracked.int32', (['(0)'], {}), '(0)\n', (130, 133), True, 'import FWCore.ParameterSet.Config as cms\n'), ((156, 181), 'FWCore.ParameterSet.Config.untracked.bool', 'cms.untracked.bool', (['(False)'], {}), '(False)\n', (174, 181), True, 'import FWCore.Par... |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import uni... | [
"os.path.exists",
"pants.util.contextutil.temporary_file_path",
"os.listdir",
"os.path.join",
"pants.invalidation.build_invalidator.CacheKey",
"pants.cache.local_artifact_cache.LocalArtifactCache",
"pants.util.contextutil.temporary_file",
"pants.cache.local_artifact_cache.TempLocalArtifactCache",
"p... | [((3241, 3276), 'pants.invalidation.build_invalidator.CacheKey', 'CacheKey', (['"""muppet_key"""', '"""fake_hash"""'], {}), "('muppet_key', 'fake_hash')\n", (3249, 3276), False, 'from pants.invalidation.build_invalidator import CacheKey\n'), ((7484, 7519), 'pants.invalidation.build_invalidator.CacheKey', 'CacheKey', ([... |
"""
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation.
OpenAPI spec version: v1
... | [
"django.setup",
"json.dumps",
"json.loads",
"django.test.Client"
] | [((4929, 4937), 'django.test.Client', 'Client', ([], {}), '()\n', (4935, 4937), False, 'from django.test import Client\n'), ((4979, 4993), 'django.setup', 'django.setup', ([], {}), '()\n', (4991, 4993), False, 'import django\n'), ((5246, 5265), 'json.dumps', 'json.dumps', (['payload'], {}), '(payload)\n', (5256, 5265),... |
# coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | [
"tensorflow_datasets.testing.test_main",
"tensorflow.compat.v2.io.gfile.exists",
"absl.testing.absltest.mock.MagicMock",
"os.path.join",
"tensorflow.compat.v2.io.gfile.GFile",
"tensorflow_datasets.core.download.extractor.get_extractor"
] | [((5034, 5053), 'tensorflow_datasets.testing.test_main', 'testing.test_main', ([], {}), '()\n', (5051, 5053), False, 'from tensorflow_datasets import testing\n'), ((1398, 1427), 'tensorflow.compat.v2.io.gfile.GFile', 'tf.io.gfile.GFile', (['path', '"""rb"""'], {}), "(path, 'rb')\n", (1415, 1427), True, 'import tensorfl... |
from app.models.user import UserLog
from datetime import datetime
def todo_activity_logger(user: object, type: str):
log = UserLog.objects(user=user, date=datetime.now().date()).first()
if log is None:
log = UserLog(user=user)
log.save()
if type == "new":
log.update(inc__todo__ne... | [
"datetime.datetime.now",
"app.models.user.UserLog"
] | [((227, 245), 'app.models.user.UserLog', 'UserLog', ([], {'user': 'user'}), '(user=user)\n', (234, 245), False, 'from app.models.user import UserLog\n'), ((728, 746), 'app.models.user.UserLog', 'UserLog', ([], {'user': 'user'}), '(user=user)\n', (735, 746), False, 'from app.models.user import UserLog\n'), ((161, 175), ... |
import logging
import numpy as np
from os.path import join
from types import ModuleType
from inspect import getmembers, isclass
from pyquaternion import Quaternion
from pyrep import PyRep
from pyrep.backend.utils import suppress_std_out_and_err
from pyrep.errors import IKError
from pyrep.robots.arms.panda import Panda
... | [
"numpy.abs",
"pyquaternion.Quaternion",
"inspect.getmembers",
"rlbench.backend.scene.Scene",
"rlbench.observation_config.ObservationConfig",
"pyrep.backend.utils.suppress_std_out_and_err",
"pyrep.robots.arms.panda.Panda",
"pyrep.robots.end_effectors.panda_gripper.PandaGripper",
"os.path.join",
"rl... | [((1405, 1447), 'rlbench.observation_config.ObservationConfig', 'ObservationConfig', ([], {'task_low_dim_state': '(True)'}), '(task_low_dim_state=True)\n', (1422, 1447), False, 'from rlbench.observation_config import ObservationConfig\n'), ((1492, 1504), 'rlbench.action_modes.ActionMode', 'ActionMode', ([], {}), '()\n'... |
import os
try:
import cPickle as pickle
except:
import pickle
import BitVector
import logging
logger = logging.getLogger('cache')
class CacheMetaData(object):
def __init__(self, metaDataFile, blocks, md5sum, size):
"""
Creates an instance of CacheMetaData for the given file. If the same... | [
"logging.getLogger",
"os.path.exists",
"pickle.dump",
"BitVector.BitVector",
"pickle.load",
"os.path.dirname",
"os.remove"
] | [((114, 140), 'logging.getLogger', 'logging.getLogger', (['"""cache"""'], {}), "('cache')\n", (131, 140), False, 'import logging\n'), ((1038, 1071), 'os.path.exists', 'os.path.exists', (['self.metaDataFile'], {}), '(self.metaDataFile)\n', (1052, 1071), False, 'import os\n'), ((4984, 5012), 'os.remove', 'os.remove', (['... |
# -*- coding: utf-8 -*-
# file: data_utils_for_inferring.py
# time: 2021/4/22 0022
# author: yangheng <<EMAIL>>
# github: https://github.com/yangheng95
# Copyright (C) 2021. All Rights Reserved.
import numpy as np
from pyabsa.utils.pyabsa_utils import check_and_fix_labels, validate_example
from torch.utils.data import ... | [
"pyabsa.utils.pyabsa_utils.validate_example",
"numpy.array",
"tqdm.tqdm",
"numpy.asarray"
] | [((2899, 2948), 'tqdm.tqdm', 'tqdm', (['samples'], {'postfix': '"""building word indices..."""'}), "(samples, postfix='building word indices...')\n", (2903, 2948), False, 'from tqdm import tqdm\n'), ((4669, 4713), 'pyabsa.utils.pyabsa_utils.validate_example', 'validate_example', (['text_raw', 'aspect', 'polarity'], {})... |
#!/usr/bin/env python
# Copyright: (c) 2020, <NAME>
# Apache 2.0 License, http://www.apache.org/licenses/
from __future__ import absolute_import, division, print_function
import sys
import os
import os.path
__metaclass__ = type
DOCUMENTATION = r"""
---
module: python_script
short_description: Evaluate python code
... | [
"ansible.module_utils.basic.AnsibleModule"
] | [((2301, 2367), 'ansible.module_utils.basic.AnsibleModule', 'AnsibleModule', ([], {'argument_spec': 'module_args', 'supports_check_mode': '(True)'}), '(argument_spec=module_args, supports_check_mode=True)\n', (2314, 2367), False, 'from ansible.module_utils.basic import AnsibleModule\n')] |
from django.urls import path
from rest_framework.routers import DefaultRouter
from audit_management import views
router = DefaultRouter()
app_name = 'audit_management'
urlpatterns = [
path('', views.ListFinancingAuditView.as_view(), name='finance_audit_list')
]
| [
"audit_management.views.ListFinancingAuditView.as_view",
"rest_framework.routers.DefaultRouter"
] | [((124, 139), 'rest_framework.routers.DefaultRouter', 'DefaultRouter', ([], {}), '()\n', (137, 139), False, 'from rest_framework.routers import DefaultRouter\n'), ((201, 239), 'audit_management.views.ListFinancingAuditView.as_view', 'views.ListFinancingAuditView.as_view', ([], {}), '()\n', (237, 239), False, 'from audi... |
#!/usr/bin/env python3
"""
Pipeline for PANGAEA data, with custom NETCDF reading.
This script allows for data updates.
@author: giuseppeperonato
"""
import json
import logging
import os
import shutil
import sys
import frictionless
import numpy as np
import pandas as pd
import requests
import utilities
import xarray
... | [
"pandas.read_csv",
"utilities.get_query_metadata",
"utilities.isDFvalid",
"frictionless.describe_package",
"utilities.datasetExists",
"utilities.get_ld_json",
"logging.info",
"pandas.to_datetime",
"os.remove",
"os.path.exists",
"utilities.getDataPackage",
"json.dumps",
"os.mkdir",
"pandas.... | [((356, 395), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (375, 395), False, 'import logging\n'), ((902, 921), 'pyproj.CRS.from_epsg', 'CRS.from_epsg', (['(3035)'], {}), '(3035)\n', (915, 921), False, 'from pyproj import CRS\n'), ((6865, 6988), 'pandas.DataFr... |
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 27 20:00:33 2021
@author: Mahsa
"""
import analyze_sensitivity
import pandas as pd
#sensitivity results for statusQuo strategy
output1=analyze_sensitivity.run_sensitivity_statusQuo('r',10)
output2=analyze_sensitivity.run_sensitivity_statusQuo('r',-10)
output3=analyze_se... | [
"pandas.DataFrame",
"analyze_sensitivity.run_sensitivity_statusQuo"
] | [((185, 239), 'analyze_sensitivity.run_sensitivity_statusQuo', 'analyze_sensitivity.run_sensitivity_statusQuo', (['"""r"""', '(10)'], {}), "('r', 10)\n", (230, 239), False, 'import analyze_sensitivity\n'), ((247, 302), 'analyze_sensitivity.run_sensitivity_statusQuo', 'analyze_sensitivity.run_sensitivity_statusQuo', (['... |
""" dlgis package configuration
"""
from typing import Any, Dict
import setuptools # type: ignore
about: Dict[Any, Any] = {}
with open("dlgis/__about__.py") as f:
exec(f.read(), about)
with open("README.md", "r") as f:
long_description = f.read()
setuptools.setup(
name=about["name"],
version=about["... | [
"setuptools.find_packages"
] | [((585, 611), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (609, 611), False, 'import setuptools\n')] |
#!/usr/bin/env python3
#encoding: utf-8
import os
import time
import numpy as np
import LED
import pandas as pd
import fixedsizes as fx
import pickle
import lirc
def blank_display():
for i in range(LED.DRIVER_COUNT*24):
LED.tlc5947[i] = 0
LED.tlc5947.write()
def apply_pattern(filename):
global LED, pattern_selec... | [
"lirc.nextcode",
"pickle.load",
"time.sleep",
"LED.tlc5947.write",
"lirc.init",
"LED.Init_Panel",
"numpy.shape"
] | [((244, 263), 'LED.tlc5947.write', 'LED.tlc5947.write', ([], {}), '()\n', (261, 263), False, 'import LED\n'), ((457, 471), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (468, 471), False, 'import pickle\n'), ((489, 505), 'numpy.shape', 'np.shape', (['Render'], {}), '(Render)\n', (497, 505), True, 'import numpy as... |
# pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
# pylint:disable=too-many-arguments
import filecmp
from pathlib import Path
from typing import Callable
from uuid import uuid4
import np_helpers
import pytest
from simcore_sdk.node_ports_common import e... | [
"pathlib.Path",
"simcore_sdk.node_ports_common.filemanager.entry_exists",
"simcore_sdk.node_ports_common.filemanager.upload_file",
"uuid.uuid4",
"pytest.raises",
"simcore_sdk.node_ports_common.filemanager.get_file_metadata",
"simcore_sdk.node_ports_common.filemanager.download_file_from_s3",
"filecmp.c... | [((1682, 1724), 'filecmp.cmp', 'filecmp.cmp', (['download_file_path', 'file_path'], {}), '(download_file_path, file_path)\n', (1693, 1724), False, 'import filecmp\n'), ((706, 718), 'pathlib.Path', 'Path', (['tmpdir'], {}), '(tmpdir)\n', (710, 718), False, 'from pathlib import Path\n'), ((890, 1010), 'simcore_sdk.node_p... |
from collections import defaultdict
class Graph:
def __init__ (self, vertices):
self.V = vertices # No. of vertices
self.graph = defaultdict(list) # default dictionary to store graph
self.Time = 0
# function to add an edge to graph
def addEdge (self, u, v):
self.graph[u... | [
"collections.defaultdict"
] | [((153, 170), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (164, 170), False, 'from collections import defaultdict\n')] |
from selenium import webdriver
from bs4 import BeautifulSoup
import os
import time
#DataSet
videoNames = []
links = []
#Enter Name of Song
songNames = input("Enter Song Names(Seperated by ,):\t")
songs_list = songNames.split(",")
download_directory = '/home/madhav/Music'
# To prevent download dialog
profile = webdr... | [
"bs4.BeautifulSoup",
"selenium.webdriver.Firefox",
"selenium.webdriver.FirefoxProfile",
"time.sleep"
] | [((315, 341), 'selenium.webdriver.FirefoxProfile', 'webdriver.FirefoxProfile', ([], {}), '()\n', (339, 341), False, 'from selenium import webdriver\n'), ((662, 688), 'selenium.webdriver.Firefox', 'webdriver.Firefox', (['profile'], {}), '(profile)\n', (679, 688), False, 'from selenium import webdriver\n'), ((2146, 2162)... |
#!/bin/env python
# -*- coding: utf-8 -*-
##
# __init__.py: Logic for launching and configuring Q# clients.
##
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
##
import os
import sys
import time
import logging
import jupyter_client
from distutils.util import strtobool
cl... | [
"logging.getLogger",
"time.sleep",
"os.getenv"
] | [((458, 485), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (475, 485), False, 'import logging\n'), ((506, 546), 'os.getenv', 'os.getenv', (['"""QSHARP_PY_CLIENT"""', '"""iqsharp"""'], {}), "('QSHARP_PY_CLIENT', 'iqsharp')\n", (515, 546), False, 'import os\n'), ((1461, 1474), 'time.sleep... |
import json
import unittest
from dashio import SliderSingleBar
from dashio.iotcontrol.enums import Color, Icon, SliderBarType
def _get_cfg_dict(cfg_str):
json_str = cfg_str.rpartition('\t')[2]
return json.loads(json_str)
class TestSliderSingleBar(unittest.TestCase):
def test_slider_single_bar_control_... | [
"unittest.main",
"json.loads",
"dashio.iotcontrol.enums.SliderBarType",
"dashio.SliderSingleBar"
] | [((211, 231), 'json.loads', 'json.loads', (['json_str'], {}), '(json_str)\n', (221, 231), False, 'import json\n'), ((3613, 3628), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3626, 3628), False, 'import unittest\n'), ((355, 382), 'dashio.SliderSingleBar', 'SliderSingleBar', (['"""SLIDERID"""'], {}), "('SLIDERID... |
# -*- coding: utf-8 -*-
#
# inventory/categories/api/tests/test_categories_api.py
#
from django.contrib.auth import get_user_model
from rest_framework.reverse import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from inventory.categories.models import Category
from inventory.c... | [
"django.contrib.auth.get_user_model",
"inventory.categories.models.Category.objects.all",
"rest_framework.reverse.reverse",
"inventory.categories.models.Category.objects.create_category_tree"
] | [((424, 440), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (438, 440), False, 'from django.contrib.auth import get_user_model\n'), ((1078, 1118), 'rest_framework.reverse.reverse', 'reverse', (['"""project-detail"""'], {'kwargs': 'kwargs'}), "('project-detail', kwargs=kwargs)\n", (1085, 1118... |
import torch
import torch.nn as nn
import torch.optim as optim
from tensorboardX import SummaryWriter
from torch.utils.data import TensorDataset, DataLoader
import argparse
# Device configuration
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# Hyperparameters
window_size = 10
input_size = 1
hid... | [
"torch.nn.CrossEntropyLoss",
"tensorboardX.SummaryWriter",
"argparse.ArgumentParser",
"torch.nn.LSTM",
"torch.tensor",
"torch.cuda.is_available",
"torch.nn.Linear",
"torch.utils.data.DataLoader"
] | [((1799, 1824), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1822, 1824), False, 'import argparse\n'), ((2281, 2358), 'torch.utils.data.DataLoader', 'DataLoader', (['seq_dataset'], {'batch_size': 'batch_size', 'shuffle': '(True)', 'pin_memory': '(True)'}), '(seq_dataset, batch_size=batch_siz... |
from django.conf.urls import url
from apps.myadmin.views import login, user, team, role, teamUserRelation, userRole, adminUser, businessLine, \
interfaceModule, interfacePermission, moduleManage, source, changeLog, businessLineModule, configService, \
jiraModule, modulePlatform, jiraBusinessLine, jiraBusiness... | [
"django.conf.urls.url"
] | [((692, 746), 'django.conf.urls.url', 'url', (['"""^myadmin/$"""', 'login.loginPage'], {'name': '"""admin_login"""'}), "('^myadmin/$', login.loginPage, name='admin_login')\n", (695, 746), False, 'from django.conf.urls import url\n'), ((753, 812), 'django.conf.urls.url', 'url', (['"""^myadmin/login$"""', 'login.loginPag... |
# -*- coding: utf-8 -*-
from urllib.parse import quote, unquote, urlencode
from collections import namedtuple
#from Crypto.Cipher import AES
import base64, hashlib, os
#import axolotl_curve25519 as Curve25519
KeyPairCurve = namedtuple('KeyPair', ['private_key', 'public_key', 'nonce'])
AESKeyAndIV = namedtuple('AESKey'... | [
"hashlib.sha256",
"collections.namedtuple",
"os.urandom",
"base64.b64encode",
"urllib.parse.quote",
"base64.b64decode"
] | [((225, 286), 'collections.namedtuple', 'namedtuple', (['"""KeyPair"""', "['private_key', 'public_key', 'nonce']"], {}), "('KeyPair', ['private_key', 'public_key', 'nonce'])\n", (235, 286), False, 'from collections import namedtuple\n'), ((301, 336), 'collections.namedtuple', 'namedtuple', (['"""AESKey"""', "['Key', 'I... |
"""This file provides MovesMouse"""
# pylint: disable=invalid-name
# pylint: disable=protected-access
from random import randint
from xcffib.xproto import Atom
from wotw_x11_comparison.common import UsesXcbWindowProperties
class MovesMouse(UsesXcbWindowProperties):
"""This class uses XCB bindings to move the mo... | [
"random.randint"
] | [((1184, 1210), 'random.randint', 'randint', (['(0)', 'geometry.width'], {}), '(0, geometry.width)\n', (1191, 1210), False, 'from random import randint\n'), ((1224, 1251), 'random.randint', 'randint', (['(0)', 'geometry.height'], {}), '(0, geometry.height)\n', (1231, 1251), False, 'from random import randint\n')] |
import argparse
import logging
from typing import Optional
from typing import Sequence
from poetry_hooks.utils import get__version__changed
from poetry_hooks.utils import write__version__
logger = logging.getLogger(__name__)
def parse_args(argv):
logger.debug("arguments: {}".format(argv))
parser = argparse... | [
"logging.getLogger",
"poetry_hooks.utils.write__version__",
"poetry_hooks.utils.get__version__changed",
"argparse.ArgumentParser"
] | [((200, 227), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (217, 227), False, 'import logging\n'), ((312, 337), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (335, 337), False, 'import argparse\n'), ((736, 767), 'poetry_hooks.utils.get__version__changed', 'get_... |
import copy
import os.path as osp
import torch
from .recognition_dataset import RecognitionDataset
from .registry import DATASETS
@DATASETS.register_module()
class RawframeDataset(RecognitionDataset):
"""Rawframe dataset for action recognition.
The dataset loads raw frames and apply specified transforms to... | [
"os.path.join",
"torch.zeros"
] | [((3764, 3796), 'os.path.join', 'osp.join', (['data_prefix', 'frame_dir'], {}), '(data_prefix, frame_dir)\n', (3772, 3796), True, 'import os.path as osp\n'), ((4580, 4609), 'torch.zeros', 'torch.zeros', (['self.num_classes'], {}), '(self.num_classes)\n', (4591, 4609), False, 'import torch\n')] |
"""Tankerkoenig sensor integration."""
import logging
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_LATITUDE,
ATTR_LONGITUDE,
CURRENCY_EURO,
)
from homeassistant.helpers.update_coordinator import (
CoordinatorEntity,
DataUpdat... | [
"logging.getLogger",
"homeassistant.helpers.update_coordinator.UpdateFailed",
"homeassistant.helpers.update_coordinator.DataUpdateCoordinator"
] | [((398, 425), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (415, 425), False, 'import logging\n'), ((1219, 1350), 'homeassistant.helpers.update_coordinator.DataUpdateCoordinator', 'DataUpdateCoordinator', (['hass', '_LOGGER'], {'name': 'NAME', 'update_method': 'async_update_data', 'upda... |
from ScopeFoundry.data_browser import DataBrowser, HyperSpectralBaseView
import numpy as np
class HyperSpecNPZView(HyperSpectralBaseView):
name = 'hyperspec_npz'
def is_file_supported(self, fname):
return "_spec_scan.npz" in fname
def load_data(self, fname):
self.dat = np.loa... | [
"numpy.cumsum",
"ScopeFoundry.data_browser.DataBrowser",
"numpy.load",
"numpy.apply_along_axis"
] | [((848, 863), 'numpy.cumsum', 'np.cumsum', (['spec'], {}), '(spec)\n', (857, 863), True, 'import numpy as np\n'), ((2054, 2075), 'ScopeFoundry.data_browser.DataBrowser', 'DataBrowser', (['sys.argv'], {}), '(sys.argv)\n', (2065, 2075), False, 'from ScopeFoundry.data_browser import DataBrowser, HyperSpectralBaseView\n'),... |
"""
This module is for inspecting OGR data sources and generating either
models for GeoDjango and/or mapping dictionaries for use with the
`LayerMapping` utility.
"""
from django.utils.six.moves import zip
# Requires GDAL to use.
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.gdal.field import O... | [
"django.utils.six.moves.zip",
"django.contrib.gis.gdal.DataSource"
] | [((6640, 6718), 'django.utils.six.moves.zip', 'zip', (['ogr_fields', 'layer.field_widths', 'layer.field_precisions', 'layer.field_types'], {}), '(ogr_fields, layer.field_widths, layer.field_precisions, layer.field_types)\n', (6643, 6718), False, 'from django.utils.six.moves import zip\n'), ((1102, 1125), 'django.contri... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"torchvision.datasets.CIFAR100",
"torch.nn.CrossEntropyLoss",
"third_party.WideResNet_pytorch.wideresnet.WideResNet",
"models.cifar.allconv.AllConvNet",
"numpy.mean",
"os.path.exists",
"argparse.ArgumentParser",
"third_party.ResNeXt_DenseNet.models.densenet.densenet",
"os.path.isdir",
"numpy.rando... | [((1434, 1558), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Trains a CIFAR Classifier"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description='Trains a CIFAR Classifier',\n formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n", (1457, 1558), False, 'i... |
from screenplay.behave import Actors, add_screenplay_objects_to
from screenplay import Actor
from screenplay.tests.stub_abilities import StubAbility
class Context:
pass
def test_An_Actors_object_is_added_to_a_context():
context = Context()
add_screenplay_objects_to(context)
assert isinstance(cont... | [
"screenplay.tests.stub_abilities.StubAbility",
"screenplay.behave.add_screenplay_objects_to"
] | [((258, 292), 'screenplay.behave.add_screenplay_objects_to', 'add_screenplay_objects_to', (['context'], {}), '(context)\n', (283, 292), False, 'from screenplay.behave import Actors, add_screenplay_objects_to\n'), ((427, 461), 'screenplay.behave.add_screenplay_objects_to', 'add_screenplay_objects_to', (['context'], {}),... |
import logging
import requests
import yaml
from bot.listeners import TelegramListener, AlertListener
from bot.protocol import SendExpedition
from ogame.game.const import Ship, CoordsType, Resource
from ogame.game.model import Coordinates
from ogame.util import find_unique
def parse_bot_config(config):
""" @retu... | [
"bot.listeners.AlertListener",
"ogame.game.const.Ship.from_name",
"logging.debug",
"requests.get",
"yaml.safe_load",
"ogame.game.const.CoordsType.from_name",
"ogame.game.const.Resource.from_name",
"ogame.game.model.Coordinates",
"bot.protocol.SendExpedition",
"bot.listeners.TelegramListener"
] | [((4748, 4786), 'ogame.game.const.CoordsType.from_name', 'CoordsType.from_name', (['origin_type_name'], {}), '(origin_type_name)\n', (4768, 4786), False, 'from ogame.game.const import Ship, CoordsType, Resource\n'), ((5612, 5716), 'ogame.game.model.Coordinates', 'Coordinates', ([], {'galaxy': 'origin_galaxy', 'system':... |