code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from django.conf.urls import url
from django.contrib import admin
try:
# django < 1.10
from django.conf.urls import patterns
from django.conf.urls import include
urlpatterns = patterns(
'',
url(r'^admin/', include(admin.site.urls)),
)
except ImportError:
urlpatterns = [
... | [
"django.conf.urls.include",
"django.conf.urls.url"
] | [((240, 264), 'django.conf.urls.include', 'include', (['admin.site.urls'], {}), '(admin.site.urls)\n', (247, 264), False, 'from django.conf.urls import include\n'), ((321, 352), 'django.conf.urls.url', 'url', (['"""^admin/"""', 'admin.site.urls'], {}), "('^admin/', admin.site.urls)\n", (324, 352), False, 'from django.c... |
from __future__ import print_function
import FWCore.ParameterSet.Config as cms
#
process = cms.Process("BeamSpotDipServer")
process.load("DQMServices.Core.DQM_cfg")
# message logger
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cerr = cms.untracked.PSet(
threshold = cms.untracked.st... | [
"FWCore.ParameterSet.Config.string",
"FWCore.ParameterSet.Config.untracked.int32",
"FWCore.ParameterSet.Config.uint64",
"FWCore.ParameterSet.Config.untracked.vstring",
"FWCore.ParameterSet.Config.untracked.string",
"FWCore.ParameterSet.Config.Process",
"FWCore.ParameterSet.Config.Path"
] | [((92, 124), 'FWCore.ParameterSet.Config.Process', 'cms.Process', (['"""BeamSpotDipServer"""'], {}), "('BeamSpotDipServer')\n", (103, 124), True, 'import FWCore.ParameterSet.Config as cms\n'), ((1484, 1519), 'FWCore.ParameterSet.Config.Path', 'cms.Path', (['process.beamSpotDipServer'], {}), '(process.beamSpotDipServer)... |
from flask_rest_jsonapi import ResourceDetail, ResourceList, \
ResourceRelationship
from app.api.bootstrap import api
from app.api.schema.custom_system_roles import CustomSystemRoleSchema
from app.models import db
from app.models.custom_system_role import CustomSysRole
from app.models.panel_permission import Panel... | [
"app.api.helpers.db.safe_query",
"app.api.bootstrap.api.has_permission",
"app.models.custom_system_role.CustomSysRole.panel_permissions.any"
] | [((951, 997), 'app.api.bootstrap.api.has_permission', 'api.has_permission', (['"""is_admin"""'], {'methods': '"""POST"""'}), "('is_admin', methods='POST')\n", (969, 997), False, 'from app.api.bootstrap import api\n'), ((1754, 1808), 'app.api.bootstrap.api.has_permission', 'api.has_permission', (['"""is_admin"""'], {'me... |
from . import arguments
from . import options
from .. import util
import click
import os
@click.command('find')
@options.all()
@options.null()
@options.recursive()
@options.tree()
@arguments.tag()
@arguments.path()
def find_command(all, null, recursive, tree, tag, path):
'''Find files by tag.
\b
TAG tag ... | [
"os.path.split",
"click.command"
] | [((91, 112), 'click.command', 'click.command', (['"""find"""'], {}), "('find')\n", (104, 112), False, 'import click\n'), ((893, 912), 'os.path.split', 'os.path.split', (['path'], {}), '(path)\n', (906, 912), False, 'import os\n'), ((1135, 1162), 'os.path.split', 'os.path.split', (['files[index]'], {}), '(files[index])\... |
import pathlib
import os.path
import logging
logger = logging.getLogger(__name__)
curr_path = pathlib.Path(__file__).parent.absolute()
def jl_test_file_path(filename):
return os.path.join(curr_path, "jl_render", filename)
def click_undo(self):
undo_selector = "._dash-undo-redo span:first-child div:last-child"... | [
"pathlib.Path",
"logging.getLogger"
] | [((54, 81), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (71, 81), False, 'import logging\n'), ((95, 117), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (107, 117), False, 'import pathlib\n')] |
import datetime as dt
from rest_framework import serializers
from rest_framework.validators import UniqueValidator
from rest_framework_simplejwt.tokens import RefreshToken
from django.db.models import Avg
from content_api.models import Category, Comment, Genre, Review, Title
from users.models import User, UserCode
cl... | [
"users.models.UserCode.objects.get",
"users.models.User.objects.get",
"rest_framework.serializers.SerializerMethodField",
"content_api.models.Genre.objects.all",
"rest_framework_simplejwt.tokens.RefreshToken.for_user",
"datetime.timedelta",
"rest_framework.serializers.SlugRelatedField",
"django.db.mod... | [((1979, 2014), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField', ([], {}), '()\n', (2012, 2014), False, 'from rest_framework import serializers\n'), ((2758, 2837), 'rest_framework.serializers.SlugRelatedField', 'serializers.SlugRelatedField', ([], {'slug_field': '"""username"""',... |
# Copyright (c) 2016 Intel, Inc.
# Copyright (c) 2013 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/li... | [
"oslo_config.cfg.StrOpt",
"oslo_config.cfg.BoolOpt",
"oslo_config.cfg.OptGroup",
"oslo_config.cfg.ListOpt"
] | [((724, 1110), 'oslo_config.cfg.OptGroup', 'cfg.OptGroup', ([], {'name': '"""notifications"""', 'title': '"""Notifications options"""', 'help': '"""\nMost of the actions in Nova which manipulate the system state generate\nnotifications which are posted to the messaging component (e.g. RabbitMQ) and\ncan be consumed by ... |
from cnabera import core
class TestCore:
def test_main(self):
expected_msg = 'print from application'
assert core.main() == expected_msg
| [
"cnabera.core.main"
] | [((131, 142), 'cnabera.core.main', 'core.main', ([], {}), '()\n', (140, 142), False, 'from cnabera import core\n')] |
from testing_config import BaseTestConfig
from application.models import User
import json
from application.utils import auth
class TestAPI(BaseTestConfig):
some_user = {
"email": "<EMAIL>",
"password": "<PASSWORD>",
"username": "test_user1"
}
def test_get_spa_from_index(self):
... | [
"application.utils.auth.verify_token",
"application.models.User.query.filter_by",
"application.models.User.get_user_with_email_and_password",
"json.dumps"
] | [((1501, 1525), 'application.utils.auth.verify_token', 'auth.verify_token', (['token'], {}), '(token)\n', (1518, 1525), False, 'from application.utils import auth\n'), ((2934, 3035), 'application.models.User.get_user_with_email_and_password', 'User.get_user_with_email_and_password', (["self.default_user['email']", "sel... |
from i18n.strings import LazyI18nString
from pytest import mark
def _query_pages(client, conference_code):
return client.query(
"""query Pages($code: String!) {
pages(code: $code) {
id
title
slug
content
image
... | [
"i18n.strings.LazyI18nString"
] | [((1366, 1396), 'i18n.strings.LazyI18nString', 'LazyI18nString', (["{'en': 'demo'}"], {}), "({'en': 'demo'})\n", (1380, 1396), False, 'from i18n.strings import LazyI18nString\n'), ((2296, 2364), 'i18n.strings.LazyI18nString', 'LazyI18nString', (["{'en': 'this is a test', 'it': 'questa è una prova'}"], {}), "({'en': 'th... |
# Standard modules
import datetime
# External modules
# chronicle modules
from chronicle import Responder
from chronicle.responder import ResponderKeyError
class TextScribe(Responder):
def __init__(self, file_name_txt):
self.file_name = file_name_txt
self.messengers = {}
def register(se... | [
"chronicle.responder.ResponderKeyError",
"datetime.datetime.utcnow"
] | [((387, 413), 'datetime.datetime.utcnow', 'datetime.datetime.utcnow', ([], {}), '()\n', (411, 413), False, 'import datetime\n'), ((619, 645), 'datetime.datetime.utcnow', 'datetime.datetime.utcnow', ([], {}), '()\n', (643, 645), False, 'import datetime\n'), ((1366, 1437), 'chronicle.responder.ResponderKeyError', 'Respon... |
import torch
import torch.nn as nn
import math
import torch.nn.functional as F
class Previewing_aware_Attention(nn.Module):
dim_in: int
dim_k: int
dim_v: int
def __init__(self, opt, dim_in_q, dim_in, dim_k, dim_v, dropout=0.2):
super(Previewing_aware_Attention, self).__init__()
self.d... | [
"torch.nn.Dropout",
"torch.bmm",
"math.sqrt",
"torch.softmax",
"torch.nn.LayerNorm",
"torch.nn.Linear"
] | [((446, 494), 'torch.nn.Linear', 'nn.Linear', (['self.dim_in_q', 'self.dim_k'], {'bias': '(False)'}), '(self.dim_in_q, self.dim_k, bias=False)\n', (455, 494), True, 'import torch.nn as nn\n'), ((519, 565), 'torch.nn.Linear', 'nn.Linear', (['self.dim_in', 'self.dim_k'], {'bias': '(False)'}), '(self.dim_in, self.dim_k, b... |
import logging
LOG = logging.getLogger(__name__)
class ConsoleTask(object):
def __repr__(self):
return "Console @ %x" % (id(self),)
def run(self, bridge):
sock = bridge.stdin()
sock.write("{%shell begin %}")
while True:
sock.write(u"> ")
line = sock.re... | [
"logging.getLogger"
] | [((22, 49), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (39, 49), False, 'import logging\n')] |
# Copyright (c) 2020
# Author: xiaoweixiang
# The following comment should be removed at some point in the future.
# mypy: disallow-untyped-defs=False
import logging
import os
import subprocess
from pip._internal.cli.base_command import Command
from pip._internal.cli.status_codes import ERROR, SUCCESS
from pip._in... | [
"pip._internal.exceptions.PipError",
"pip._internal.utils.misc.write_output",
"pip._internal.configuration.get_configuration_files",
"os.path.exists",
"logging.getLogger",
"pip._internal.configuration.Configuration",
"pip._internal.utils.misc.get_prog",
"subprocess.check_call"
] | [((527, 554), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (544, 554), False, 'import logging\n'), ((3573, 3639), 'pip._internal.configuration.Configuration', 'Configuration', ([], {'isolated': 'options.isolated_mode', 'load_only': 'load_only'}), '(isolated=options.isolated_mode, load_o... |
# Copyright 2017 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | [
"dm_control.rl.control.Environment",
"dm_control.utils.containers.TaggedTasks",
"six.moves.range",
"lxml.etree.Element",
"dm_control.suite.utils.randomizers.randomize_limited_and_rotational_joints",
"lxml.etree.SubElement",
"collections.OrderedDict",
"lxml.etree.tostring"
] | [((1213, 1237), 'dm_control.utils.containers.TaggedTasks', 'containers.TaggedTasks', ([], {}), '()\n', (1235, 1237), False, 'from dm_control.utils import containers\n'), ((2786, 2906), 'dm_control.rl.control.Environment', 'control.Environment', (['physics', 'task'], {'time_limit': 'time_limit', 'control_timestep': '_CO... |
# 建立文件夹为相对路径,相对当前所在路径
# shutil 最好也使用相对路径
import glob
import shutil
from pathlib import Path
if __name__ == '__main__':
cities = ["aachen", "bochum", "bremen", "cologne", "darmstadt",
"dusseldorf", "erfurt", "hamburg", "hanover", "jena", "krefeld",
"monchengladbach", "strasbourg... | [
"pathlib.Path",
"shutil.move",
"glob.glob"
] | [((563, 584), 'pathlib.Path', 'Path', (["(root + '/train')"], {}), "(root + '/train')\n", (567, 584), False, 'from pathlib import Path\n'), ((625, 644), 'pathlib.Path', 'Path', (["(root + '/val')"], {}), "(root + '/val')\n", (629, 644), False, 'from pathlib import Path\n'), ((755, 783), 'glob.glob', 'glob.glob', (["(or... |
# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed
# under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | [
"model.ConfigFactory.from_dict",
"model.ConfigSetSerialiser"
] | [((2272, 2320), 'model.ConfigSetSerialiser', 'CSS', ([], {'cfg_sets': 'cfg_sets', 'cfg_factory': 'self.factory'}), '(cfg_sets=cfg_sets, cfg_factory=self.factory)\n', (2275, 2320), True, 'from model import ConfigSetSerialiser as CSS, ConfigFactory\n'), ((2442, 2475), 'model.ConfigFactory.from_dict', 'ConfigFactory.from_... |
import tensorflow as tf
import skimage.transform
import numpy as np
def conv2d(x, W, b, strides=1):
# Conv2D wrapper, with bias and relu activation
x = tf.nn.conv2d(x, W, strides=[1, strides, strides, 1], padding='SAME')
x = tf.nn.bias_add(x, b)
return tf.nn.relu(x)
def maxpool2d(x, k=2):
# Wrap... | [
"numpy.stack",
"tensorflow.image.resize_images",
"tensorflow.nn.relu",
"numpy.zeros",
"tensorflow.nn.max_pool",
"tensorflow.nn.conv2d",
"numpy.random.choice",
"tensorflow.nn.bias_add"
] | [((162, 230), 'tensorflow.nn.conv2d', 'tf.nn.conv2d', (['x', 'W'], {'strides': '[1, strides, strides, 1]', 'padding': '"""SAME"""'}), "(x, W, strides=[1, strides, strides, 1], padding='SAME')\n", (174, 230), True, 'import tensorflow as tf\n'), ((239, 259), 'tensorflow.nn.bias_add', 'tf.nn.bias_add', (['x', 'b'], {}), '... |
# WSGI start script for gunicorn in docker
# usage: gunicorn -c gunicorn_conf.py main:app --threads 2 -b 0.0.0.0:80
from app import create_app
app = create_app()
| [
"app.create_app"
] | [((151, 163), 'app.create_app', 'create_app', ([], {}), '()\n', (161, 163), False, 'from app import create_app\n')] |
from __future__ import annotations
from typing import Any, Callable, Container, Deque, Dict, Iterable, Iterator, List, NoReturn, Optional, Reversible, Sequence, Set, Sized, TYPE_CHECKING, Tuple, Type, Generic, Union
if TYPE_CHECKING:
from .lookup import Lookup
from .grouping import Grouping
from .ordered_e... | [
"typing.Deque"
] | [((24344, 24351), 'typing.Deque', 'Deque', ([], {}), '()\n', (24349, 24351), False, 'from typing import Any, Callable, Container, Deque, Dict, Iterable, Iterator, List, NoReturn, Optional, Reversible, Sequence, Set, Sized, TYPE_CHECKING, Tuple, Type, Generic, Union\n')] |
"""Example code for the nodes in the example pipeline. This code is meant
just for illustrating basic Kedro features.
Delete this when you start working on your own Kedro project.
"""
# pylint: disable=invalid-name
import logging
from typing import Any, Dict
import numpy as np
import pandas as pd
def train_model(
... | [
"numpy.sum",
"numpy.concatenate",
"numpy.argmax",
"numpy.zeros",
"numpy.ones",
"numpy.vstack",
"numpy.exp",
"numpy.dot",
"logging.getLogger"
] | [((910, 934), 'numpy.ones', 'np.ones', (['(X.shape[0], 1)'], {}), '((X.shape[0], 1))\n', (917, 934), True, 'import numpy as np\n'), ((943, 976), 'numpy.concatenate', 'np.concatenate', (['(bias, X)'], {'axis': '(1)'}), '((bias, X), axis=1)\n', (957, 976), True, 'import numpy as np\n'), ((1740, 1764), 'numpy.ones', 'np.o... |
from django.contrib.admin import ModelAdmin, site
from django.utils.translation import gettext_lazy as _
from respa_o365.models import OutlookCalendarLink
class OutlookCalendarLinkAdmin(ModelAdmin):
list_display = ('resource', 'user')
search_fields = ('resource', 'user')
fields = ('resource', 'user', 'rese... | [
"django.contrib.admin.site.register",
"django.utils.translation.gettext_lazy"
] | [((768, 828), 'django.contrib.admin.site.register', 'site.register', (['OutlookCalendarLink', 'OutlookCalendarLinkAdmin'], {}), '(OutlookCalendarLink, OutlookCalendarLinkAdmin)\n', (781, 828), False, 'from django.contrib.admin import ModelAdmin, site\n'), ((688, 711), 'django.utils.translation.gettext_lazy', '_', (['""... |
''' Home based pages: home, resume and blog (future implementation) '''
from django.shortcuts import render
from django.views.generic import TemplateView
import helpers.import_common_class.paragraph_helpers as para_helper
from common_classes.paragraphs_for_display_cat import ParagraphsForDisplayCat
def home(request):... | [
"django.shortcuts.render",
"helpers.import_common_class.paragraph_helpers.paragraph_view_input"
] | [((332, 365), 'django.shortcuts.render', 'render', (['request', '"""home/home.html"""'], {}), "(request, 'home/home.html')\n", (338, 365), False, 'from django.shortcuts import render\n'), ((848, 921), 'helpers.import_common_class.paragraph_helpers.paragraph_view_input', 'para_helper.paragraph_view_input', (['context', ... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# Docker-Services-CLI is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""Module tests."""
import os
import pytest
from docker_services_cli.env import _is_version, _load_or_set... | [
"os.environ.get",
"pytest.raises",
"docker_services_cli.env._is_version",
"docker_services_cli.env._load_or_set_env"
] | [((361, 378), 'docker_services_cli.env._is_version', '_is_version', (['"""10"""'], {}), "('10')\n", (372, 378), False, 'from docker_services_cli.env import _is_version, _load_or_set_env\n'), ((390, 409), 'docker_services_cli.env._is_version', '_is_version', (['"""10.1"""'], {}), "('10.1')\n", (401, 409), False, 'from d... |
from __future__ import division, absolute_import, print_function
import unittest
import numpy.testing as testing
import numpy as np
import healpy as hp
import healsparse
class UpdateValuesTestCase(unittest.TestCase):
def test_update_values_inorder(self):
"""
Test doing update_values, in coarse pi... | [
"unittest.main",
"healpy.pix2ang",
"numpy.testing.assert_array_almost_equal",
"numpy.testing.assert_array_equal",
"numpy.zeros",
"numpy.sort",
"numpy.array",
"numpy.arange",
"numpy.testing.assert_equal",
"healsparse.HealSparseMap.make_empty",
"numpy.concatenate"
] | [((7166, 7181), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7179, 7181), False, 'import unittest\n'), ((443, 512), 'healsparse.HealSparseMap.make_empty', 'healsparse.HealSparseMap.make_empty', (['nside_coverage', 'nside_map', 'dtype'], {}), '(nside_coverage, nside_map, dtype)\n', (478, 512), False, 'import hea... |
import os
# 1100533005張庭維
class Ping:
@property
def Description(self):
return('Ping單個ip')
def Run(self):
hostname = input('請輸入目標:')
response = os.system("ping " + hostname)
if response == 0:
print(hostname, 'is up!')
else:
print(hostname, '... | [
"os.system"
] | [((183, 212), 'os.system', 'os.system', (["('ping ' + hostname)"], {}), "('ping ' + hostname)\n", (192, 212), False, 'import os\n'), ((646, 689), 'os.system', 'os.system', (["('ping -n 1 -w 1 ' + testhostname)"], {}), "('ping -n 1 -w 1 ' + testhostname)\n", (655, 689), False, 'import os\n'), ((773, 789), 'os.system', '... |
from conans import ConanFile, CMake, tools
class ScLogger(ConanFile):
name = "sc_logger"
version = "1.0.4"
description = "Self check logger"
author = "BoykoSO <<EMAIL>>"
settings = "os", "compiler", "arch", "build_type"
generators = "cmake"
options = {
"shared": [True, False],
... | [
"conans.CMake",
"conans.tools.Git"
] | [((721, 732), 'conans.CMake', 'CMake', (['self'], {}), '(self)\n', (726, 732), False, 'from conans import ConanFile, CMake, tools\n'), ((927, 967), 'conans.tools.Git', 'tools.Git', ([], {'folder': 'self._source_subfolder'}), '(folder=self._source_subfolder)\n', (936, 967), False, 'from conans import ConanFile, CMake, t... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-03 06:06
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('posts', '0004_auto_20160903_0546'),
]
operations = ... | [
"django.db.models.ForeignKey"
] | [((431, 542), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'null': '(True)', 'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""posts.Category"""'}), "(blank=True, null=True, on_delete=django.db.models.\n deletion.CASCADE, to='posts.Category')\n", (448, 542), False, 'from dja... |
import torch
import torch.nn as nn
import torch.nn.functional as F
class FirstBlock(nn.Module):
def __init__(self, classes = 809):
super(FirstBlock, self).__init__()
self.classes=classes
# classes
self.fc1_c = nn.Linear(classes, 512)
self.fc2_c = nn.Linear(512, 5... | [
"torch.nn.ReLU",
"torch.nn.ConvTranspose2d",
"torch.split",
"torch.nn.Conv2d",
"torch.cat",
"torch.nn.Linear"
] | [((258, 281), 'torch.nn.Linear', 'nn.Linear', (['classes', '(512)'], {}), '(classes, 512)\n', (267, 281), True, 'import torch.nn as nn\n'), ((304, 323), 'torch.nn.Linear', 'nn.Linear', (['(512)', '(512)'], {}), '(512, 512)\n', (313, 323), True, 'import torch.nn as nn\n'), ((365, 382), 'torch.nn.Linear', 'nn.Linear', ([... |
# -*- coding: utf-8 -*-
# Copyright (C) 2019 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Unit test suite for util url_parser."""
import unittest
import ddt
from ggrc.utils import url_parser
@ddt.ddt
class TestUrlParser(unittest.TestCase):
"""Unittests for user g... | [
"ddt.data",
"ggrc.utils.url_parser.parse"
] | [((344, 740), 'ddt.data', 'ddt.data', (['[\'https://www.google.com/\',\n \'<a href="https://www.google.com/">https://www.google.com/</a>\']', '[\'http://www.google.com/\',\n \'<a href="http://www.google.com/">http://www.google.com/</a>\']', '[\'http://www.google.com\',\n \'<a href="http://www.google.com">http:... |
# -*- coding: utf-8 -*-
import setuptools
try:
import shuup_setup_utils
except ImportError:
shuup_setup_utils = None
if __name__ == "__main__":
setuptools.setup(
cmdclass=(shuup_setup_utils.COMMANDS if shuup_setup_utils else {}),
setup_requires=["setuptools>=34.0", "setuptools-gitver"],
... | [
"setuptools.setup"
] | [((159, 316), 'setuptools.setup', 'setuptools.setup', ([], {'cmdclass': '(shuup_setup_utils.COMMANDS if shuup_setup_utils else {})', 'setup_requires': "['setuptools>=34.0', 'setuptools-gitver']", 'gitver': '(True)'}), "(cmdclass=shuup_setup_utils.COMMANDS if shuup_setup_utils else\n {}, setup_requires=['setuptools>=... |
try:
import tkinter as tk
except ImportError:
import Tkinter as tk
from .canvases import ScrolledCanvas
from .variables import NodeVar
from collections import namedtuple
import math
Element = namedtuple("Element", ["id", "coords"])
BezierElement = namedtuple("BezierElement", ["id", "nodes"])
class NodeView(... | [
"math.comb",
"collections.namedtuple"
] | [((202, 241), 'collections.namedtuple', 'namedtuple', (['"""Element"""', "['id', 'coords']"], {}), "('Element', ['id', 'coords'])\n", (212, 241), False, 'from collections import namedtuple\n'), ((258, 302), 'collections.namedtuple', 'namedtuple', (['"""BezierElement"""', "['id', 'nodes']"], {}), "('BezierElement', ['id... |
"""
Allows the player to manage his team
--
Author : DrLarck
Last update : 11/09/19 (DrLarck)
"""
# dependancies
import asyncio
from discord.ext import commands
# utils
from utility.cog.player.player import Player
from utility.command._fighter import Fighter
from utility.cog.character.getter import Character_gette... | [
"utility.command._fighter.Fighter",
"utility.cog.displayer.icon.Icon_displayer",
"utility.cog.character.getter.Character_getter",
"utility.cog.player.player.Player",
"utility.graphic.embed.Custom_embed",
"utility.command.checker.basic.Basic_checker",
"discord.ext.commands.group"
] | [((840, 856), 'discord.ext.commands.group', 'commands.group', ([], {}), '()\n', (854, 856), False, 'from discord.ext import commands\n'), ((676, 694), 'utility.cog.character.getter.Character_getter', 'Character_getter', ([], {}), '()\n', (692, 694), False, 'from utility.cog.character.getter import Character_getter\n'),... |
from pathlib import Path
import numpy as np
import pytest
from npe2 import DynamicPlugin
from npe2.manifest.contributions import SampleDataURI
import napari
from napari.layers._source import Source
from napari.viewer import ViewerModel
def test_sample_hook(builtins, tmp_plugin: DynamicPlugin):
viewer = ViewerM... | [
"napari.viewer.ViewerModel",
"npe2.manifest.contributions.SampleDataURI",
"pytest.raises",
"pathlib.Path",
"numpy.random.rand",
"napari.layers._source.Source"
] | [((313, 326), 'napari.viewer.ViewerModel', 'ViewerModel', ([], {}), '()\n', (324, 326), False, 'from napari.viewer import ViewerModel\n'), ((387, 453), 'pytest.raises', 'pytest.raises', (['KeyError'], {'match': 'f"""Plugin {NAME!r} does not provide"""'}), "(KeyError, match=f'Plugin {NAME!r} does not provide')\n", (400,... |
# Copyright (c) 2015-2016 Cisco Systems, Inc.
#
# 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... | [
"molecule.util.print_info",
"molecule.util.print_error",
"json.loads",
"molecule.util.print_success",
"docker.utils.kwargs_from_env",
"collections.namedtuple",
"io.open",
"sys.exit",
"molecule.util.print_warn"
] | [((1240, 1293), 'sys.exit', 'sys.exit', (['"""ERROR: Driver missing, install docker-py."""'], {}), "('ERROR: Driver missing, install docker-py.')\n", (1248, 1293), False, 'import sys\n'), ((6128, 6200), 'collections.namedtuple', 'collections.namedtuple', (['"""Status"""', "['name', 'state', 'provider', 'ports']"], {}),... |
def example(Simulator):
import numpy as np
from csdl import Model
import csdl
class ExampleReorderMatrixSparse(Model):
def define(self):
shape2 = (5, 4)
b = np.arange(20).reshape(shape2)
mat = self.declare_variable('b', val=b)
s... | [
"csdl.einsum",
"numpy.arange"
] | [((406, 468), 'csdl.einsum', 'csdl.einsum', (['mat'], {'subscripts': '"""ij->ji"""', 'partial_format': '"""sparse"""'}), "(mat, subscripts='ij->ji', partial_format='sparse')\n", (417, 468), False, 'import csdl\n'), ((220, 233), 'numpy.arange', 'np.arange', (['(20)'], {}), '(20)\n', (229, 233), True, 'import numpy as np... |
import argparse
from dataloader import picked_train_test_data_loader
from sklearn import preprocessing
from classifier import train_best
import numpy
from bert_serving.client import BertClient
bc = BertClient()
def train_test(pickled_train_path, pickled_test_path):
train, test = picked_train_test_data_loader(pic... | [
"argparse.ArgumentParser",
"numpy.asarray",
"dataloader.picked_train_test_data_loader",
"sklearn.preprocessing.LabelEncoder",
"classifier.train_best",
"bert_serving.client.BertClient",
"numpy.vstack"
] | [((200, 212), 'bert_serving.client.BertClient', 'BertClient', ([], {}), '()\n', (210, 212), False, 'from bert_serving.client import BertClient\n'), ((287, 355), 'dataloader.picked_train_test_data_loader', 'picked_train_test_data_loader', (['pickled_train_path', 'pickled_test_path'], {}), '(pickled_train_path, pickled_t... |
#!/usr/bin/env python
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (t... | [
"d1_onedrive.impl.onedrive_exceptions.PathException",
"d1_onedrive.impl.util.string_from_path_elements",
"d1_onedrive.impl.directory.Directory",
"d1_onedrive.impl.attributes.Attributes",
"d1_onedrive.impl.util.os_format",
"logging.getLogger"
] | [((1178, 1205), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1195, 1205), False, 'import logging\n'), ((1707, 1733), 'd1_onedrive.impl.util.os_format', 'util.os_format', (['README_TXT'], {}), '(README_TXT)\n', (1721, 1733), False, 'from d1_onedrive.impl import util\n'), ((3028, 3065), ... |
from django.contrib.auth import get_user_model
from django.test import SimpleTestCase, TestCase
from django.urls import reverse
class HomePageTests(SimpleTestCase):
def test_home_page_status_code(self):
response = self.client.get('/')
self.assertEqual(response.status_code, 200)
def test_view... | [
"django.urls.reverse",
"django.contrib.auth.get_user_model"
] | [((375, 390), 'django.urls.reverse', 'reverse', (['"""home"""'], {}), "('home')\n", (382, 390), False, 'from django.urls import reverse\n'), ((527, 542), 'django.urls.reverse', 'reverse', (['"""home"""'], {}), "('home')\n", (534, 542), False, 'from django.urls import reverse\n'), ((960, 977), 'django.urls.reverse', 're... |
from setuptools import setup, find_packages, Extension
setup(
name="pyfor",
version="0.3.6",
author="<NAME>",
author_email="<EMAIL>",
packages=["pyfor", "pyfortest"],
url="https://github.com/brycefrank/pyfor",
license="LICENSE.txt",
description="Tools for forest resource point cloud ana... | [
"setuptools.setup"
] | [((56, 370), 'setuptools.setup', 'setup', ([], {'name': '"""pyfor"""', 'version': '"""0.3.6"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'packages': "['pyfor', 'pyfortest']", 'url': '"""https://github.com/brycefrank/pyfor"""', 'license': '"""LICENSE.txt"""', 'description': '"""Tools for forest resour... |
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This libra... | [
"spyne.model._base.SimpleModel.validate_native",
"spyne.model.primitive.string.Unicode",
"spyne.model._base.SimpleModel.validate_string",
"spyne.model.primitive._base.re_match_with_span",
"uuid.UUID"
] | [((2082, 2111), 'spyne.model.primitive.string.Unicode', 'Unicode', ([], {'pattern': 'UUID_PATTERN'}), '(pattern=UUID_PATTERN)\n', (2089, 2111), False, 'from spyne.model.primitive.string import Unicode, AnyUri\n'), ((1274, 1313), 'spyne.model._base.SimpleModel.validate_string', 'SimpleModel.validate_string', (['cls', 'v... |
#!/usr/bin/env python
# Copyright 2016 Toyota Research Institute
# 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 applicabl... | [
"task_behavior_ros.batterystate.ChargeCompleteMonitor",
"task_behavior_engine.tree.Blackboard",
"argparse.ArgumentParser",
"task_behavior_ros.batterystate.ChargeOKMonitor",
"nose.tools.assert_equal",
"nose.run",
"sensor_msgs.msg.BatteryState"
] | [((10999, 11056), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Perform unit test."""'}), "(description='Perform unit test.')\n", (11022, 11056), False, 'import argparse\n'), ((11320, 11343), 'nose.run', 'nose.run', ([], {'argv': 'noseargs'}), '(argv=noseargs)\n', (11328, 11343), False,... |
from sympy import Integral, Symbol
x = Symbol( 'x' )
k = Symbol( 'k' )
Integral( k*x, x ).doit()
Integral( k*x, ( x, 0, 2 ) ).doit()
Integral( x, ( x, 2, 4 ) ).doit()
| [
"sympy.Symbol",
"sympy.Integral"
] | [((40, 51), 'sympy.Symbol', 'Symbol', (['"""x"""'], {}), "('x')\n", (46, 51), False, 'from sympy import Integral, Symbol\n'), ((58, 69), 'sympy.Symbol', 'Symbol', (['"""k"""'], {}), "('k')\n", (64, 69), False, 'from sympy import Integral, Symbol\n'), ((72, 90), 'sympy.Integral', 'Integral', (['(k * x)', 'x'], {}), '(k ... |
import pytest
from app.models import Notification, INVITE_PENDING
from tests.app.db import create_invited_org_user
@pytest.mark.parametrize('extra_args, expected_start_of_invite_url', [
(
{},
'http://localhost:6012/organisation-invitation/'
),
(
{'invite_link_host': 'https://www.... | [
"app.models.Notification.query.first",
"pytest.mark.parametrize"
] | [((120, 360), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""extra_args, expected_start_of_invite_url"""', "[({}, 'http://localhost:6012/organisation-invitation/'), ({\n 'invite_link_host': 'https://www.example.com'},\n 'https://www.example.com/organisation-invitation/')]"], {}), "('extra_args, expec... |
"""Generate typescript API files from the server spec"""
import json
import re
import collections
from . import base
def generate(state: base.ParserState, meta):
g = _Generator(state, meta)
return g.run()
##
class _Generator:
def __init__(self, state, meta):
self.state = state
self.met... | [
"collections.defaultdict",
"re.sub",
"json.dumps"
] | [((8536, 8549), 'json.dumps', 'json.dumps', (['s'], {}), '(s)\n', (8546, 8549), False, 'import json\n'), ((384, 413), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (407, 413), False, 'import collections\n'), ((7605, 7622), 're.sub', 're.sub', (['k', 'v', 'res'], {}), '(k, v, res)\n',... |
import abc
from collections import deque
import hashlib
import io
import logging
import mimetypes
import os
import os.path as osp
import tempfile
from typing import Deque
from smqtk.exceptions import InvalidUriError, NoUriResolutionError, \
ReadOnlyError
from smqtk.representation import SmqtkRepresentation
from sm... | [
"os.remove",
"tempfile.mkstemp",
"os.path.dirname",
"collections.deque",
"smqtk.exceptions.ReadOnlyError",
"os.path.isfile",
"os.close",
"smqtk.utils.file.safe_create_dir",
"mimetypes.MimeTypes",
"os.path.expanduser",
"smqtk.exceptions.NoUriResolutionError",
"logging.getLogger",
"smqtk.excep... | [((413, 434), 'mimetypes.MimeTypes', 'mimetypes.MimeTypes', ([], {}), '()\n', (432, 434), False, 'import mimetypes\n'), ((10255, 10282), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (10272, 10282), False, 'import logging\n'), ((1666, 1688), 'smqtk.exceptions.NoUriResolutionError', 'NoUr... |
import collections
import json
import os
import numpy as np
import matplotlib.pyplot as plt
from visualDet3D.evaluator.kitti.kitti_common import get_label_annos, get_label_anno
from visualDet3D.evaluator.kitti.eval import get_official_eval_result
from numba import cuda
def get_gt_annos(label_path, label_split_file):... | [
"json.load",
"visualDet3D.evaluator.kitti.eval.get_official_eval_result",
"visualDet3D.evaluator.kitti.kitti_common.get_label_annos",
"numba.cuda.select_device",
"matplotlib.pyplot.subplots",
"visualDet3D.evaluator.kitti.kitti_common.get_label_anno",
"matplotlib.pyplot.savefig"
] | [((1450, 1473), 'numba.cuda.select_device', 'cuda.select_device', (['gpu'], {}), '(gpu)\n', (1468, 1473), False, 'from numba import cuda\n'), ((1489, 1517), 'visualDet3D.evaluator.kitti.kitti_common.get_label_annos', 'get_label_annos', (['result_path'], {}), '(result_path)\n', (1504, 1517), False, 'from visualDet3D.eva... |
from flask import Flask, request
from flask_cors import CORS, cross_origin
from flask_restful import Resource, Api
from json import dumps
from flask_jsonpify import jsonify
import numpy as np
import pandas as pd
import matplotlib.pylab as plt
import seaborn as sns
from matplotlib.pylab import rcParams
from datetime im... | [
"flask_restful.Api",
"flask_jsonpify.jsonify",
"flask_cors.CORS",
"flask.Flask",
"datetime.datetime.strptime",
"numpy.array",
"sklearn.externals.joblib.load",
"numpy.round",
"flask.request.get_json"
] | [((340, 355), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (345, 355), False, 'from flask import Flask, request\n'), ((362, 370), 'flask_restful.Api', 'Api', (['app'], {}), '(app)\n', (365, 370), False, 'from flask_restful import Resource, Api\n'), ((410, 419), 'flask_cors.CORS', 'CORS', (['app'], {}), '... |
from . import EupathExporter
from . import ReferenceGenome
import sys
import os
import subprocess
class VCFFileExport(EupathExporter.Export):
# Constants
TYPE = "VCFFile"
VERSION = "1.0"
def __init__(self, args):
EupathExporter.Export.__init__(self,
VCF... | [
"os.getpid"
] | [((607, 618), 'os.getpid', 'os.getpid', ([], {}), '()\n', (616, 618), False, 'import os\n')] |
""" Does equal """
import re
pattern = re.compile("(.*) == (.*)")
def fn(groups, lsv_fn):
"""Does equal function"""
field, value = groups
try:
float_value = float(value)
return lambda data: float(lsv_fn(data, field)) == float_value
except:
return lambda data: lsv_fn(data, fiel... | [
"re.compile"
] | [((40, 66), 're.compile', 're.compile', (['"""(.*) == (.*)"""'], {}), "('(.*) == (.*)')\n", (50, 66), False, 'import re\n')] |
#!/usr/bin/env python3
# (c) https://t.me/TelethonChat/37677
# This Source Code Form is subject to the terms of the GNU
# General Public License, v.3.0. If a copy of the GPL was not distributed with this
# file, You can obtain one at https://www.gnu.org/licenses/gpl-3.0.en.html.
from telethon.sync import TelegramClien... | [
"telethon.sessions.StringSession"
] | [((651, 666), 'telethon.sessions.StringSession', 'StringSession', ([], {}), '()\n', (664, 666), False, 'from telethon.sessions import StringSession\n')] |
from models.spacy_based_ir import SpacyIR
from models.bert_sts import BertSTSIR
from models.bert_nli import BertNLIIR
import os
from tqdm import tqdm
import argparse
import pickle
import numpy as np
import json
def read_data_to_score(factfile,is_fact_fact=False,datasets=None):
data = {}
base_dir = os.environ[... | [
"tqdm.tqdm",
"models.bert_sts.BertSTSIR",
"json.loads"
] | [((639, 680), 'tqdm.tqdm', 'tqdm', (['factlines'], {'desc': '"""Processing Facts:"""'}), "(factlines, desc='Processing Facts:')\n", (643, 680), False, 'from tqdm import tqdm\n'), ((1550, 1588), 'tqdm.tqdm', 'tqdm', (['lines'], {'desc': '"""Reading Pretrained"""'}), "(lines, desc='Reading Pretrained')\n", (1554, 1588), ... |
# coding=utf-8
# Copyright 2022 NAVER AI Labs and The HuggingFace Inc. team. 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/LICENS... | [
"torch.nn.Dropout",
"torch.nn.Embedding",
"torch.cat",
"torch.nn.Softmax",
"torch.arange",
"torch.ones",
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.nn.LayerNorm",
"torch.nn.Linear",
"torch.zeros",
"torch.matmul",
"math.sqrt",
"torch.zeros_like",
"torch.nn.Tanh",
"pack... | [((4461, 4526), 'torch.nn.Embedding', 'nn.Embedding', (['config.modality_type_vocab_size', 'config.hidden_size'], {}), '(config.modality_type_vocab_size, config.hidden_size)\n', (4473, 4526), False, 'from torch import nn\n'), ((4550, 4588), 'torch.nn.Dropout', 'nn.Dropout', (['config.hidden_dropout_prob'], {}), '(confi... |
"""
This module implements the Resource classes that translate JSON from Jira REST resources
into usable objects.
"""
import json
import logging
import re
import time
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Type, Union, cast
from requests import Response
from requests.structures import Cas... | [
"logging.error",
"typing.cast",
"logging.warning",
"json.dumps",
"time.sleep",
"jira.utils.json_loads",
"requests.structures.CaseInsensitiveDict",
"jira.utils.threaded_requests.delete",
"logging.NullHandler",
"re.search",
"logging.getLogger"
] | [((1187, 1208), 'logging.NullHandler', 'logging.NullHandler', ([], {}), '()\n', (1206, 1208), False, 'import logging\n'), ((1150, 1175), 'logging.getLogger', 'logging.getLogger', (['"""jira"""'], {}), "('jira')\n", (1167, 1175), False, 'import logging\n'), ((14029, 14070), 'time.sleep', 'time.sleep', (["self._options['... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class GetRol... | [
"pulumi.runtime.invoke",
"pulumi.InvokeOptions"
] | [((3712, 3734), 'pulumi.InvokeOptions', 'pulumi.InvokeOptions', ([], {}), '()\n', (3732, 3734), False, 'import pulumi\n'), ((3825, 3931), 'pulumi.runtime.invoke', 'pulumi.runtime.invoke', (['"""azure:authorization/getRoleDefinition:getRoleDefinition"""', '__args__'], {'opts': 'opts'}), "('azure:authorization/getRoleDef... |
import logging
from io import StringIO
from unittest import TestCase
from src.utils.logger import logger
def foo():
logger.info('It works!')
class TestLoggerUtils(TestCase):
def setUp(self) -> None:
self.stream = StringIO()
self.handler = logging.StreamHandler(self.stream)
for handl... | [
"io.StringIO",
"src.utils.logger.logger.info",
"src.utils.logger.logger.addHandler",
"logging.StreamHandler",
"src.utils.logger.logger.removeHandler"
] | [((123, 147), 'src.utils.logger.logger.info', 'logger.info', (['"""It works!"""'], {}), "('It works!')\n", (134, 147), False, 'from src.utils.logger import logger\n'), ((234, 244), 'io.StringIO', 'StringIO', ([], {}), '()\n', (242, 244), False, 'from io import StringIO\n'), ((268, 302), 'logging.StreamHandler', 'loggin... |
import subprocess
import ujson as json
import numpy as np
import sys
import os
os.environ["MKL_SERVICE_FORCE_INTEL"] = "1"
runs=10
#Top k HAN, variant2; adjust train_per in helper.py
args = [
'python3',
'train.py',
'--problem-path',
'../../../LineGraphGCN/data/yelp/',
'--problem',
'yelp',
'-... | [
"numpy.average",
"numpy.asarray",
"ujson.loads",
"sys.stdout.flush"
] | [((1609, 1629), 'numpy.asarray', 'np.asarray', (['test_acc'], {}), '(test_acc)\n', (1619, 1629), True, 'import numpy as np\n'), ((1643, 1665), 'numpy.asarray', 'np.asarray', (['test_macro'], {}), '(test_macro)\n', (1653, 1665), True, 'import numpy as np\n'), ((1579, 1597), 'sys.stdout.flush', 'sys.stdout.flush', ([], {... |
from copy import deepcopy
import time
import uuid
import newspaper
from civic_jabber_ingest.models.article import Article
import civic_jabber_ingest.utils.database as db
from civic_jabber_ingest.utils.logging import get_logger, tqdm
from civic_jabber_ingest.utils.config import read_config
from civic_jabber_ingest.uti... | [
"copy.deepcopy",
"uuid.uuid4",
"civic_jabber_ingest.utils.logging.get_logger",
"newspaper.build",
"civic_jabber_ingest.utils.scrape.get_page",
"civic_jabber_ingest.utils.logging.tqdm",
"time.sleep",
"civic_jabber_ingest.utils.config.read_config",
"civic_jabber_ingest.models.article.Article.from_dict... | [((357, 369), 'civic_jabber_ingest.utils.logging.get_logger', 'get_logger', ([], {}), '()\n', (367, 369), False, 'from civic_jabber_ingest.utils.logging import get_logger, tqdm\n'), ((948, 972), 'civic_jabber_ingest.utils.config.read_config', 'read_config', (['"""newspaper"""'], {}), "('newspaper')\n", (959, 972), Fals... |
# std
import logging
from datetime import datetime, timedelta
from typing import List
from threading import Thread
from time import sleep
# project
from . import HarvesterActivityConsumer, WalletAddedCoinConsumer, FinishedSignageConsumer
from .stat_accumulators.eligible_plots_stats import EligiblePlotsStats
from .stat... | [
"threading.Thread",
"logging.warning",
"time.sleep",
"logging.info",
"src.notifier.Event",
"datetime.timedelta",
"datetime.datetime.now"
] | [((1597, 1650), 'logging.info', 'logging.info', (['"""Enabled stats for daily notifications"""'], {}), "('Enabled stats for daily notifications')\n", (1609, 1650), False, 'import logging\n'), ((1949, 2092), 'logging.info', 'logging.info', (['f"""Summary notifications will be sent out every {self._frequency_hours} hours... |
"""Module provider for exoscale"""
from __future__ import absolute_import
import logging
import requests
from lexicon.providers.base import Provider as BaseProvider
LOGGER = logging.getLogger(__name__)
HOUR = 3600
NAMESERVER_DOMAINS = ['exoscale.ch']
def provider_parser(subparser):
"""Generate subparser for ... | [
"requests.request",
"logging.getLogger"
] | [((177, 204), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (194, 204), False, 'import logging\n'), ((5699, 5810), 'requests.request', 'requests.request', (['action', '(self.api_endpoint + url)'], {'params': 'query_params', 'json': 'data', 'headers': 'default_headers'}), '(action, self.a... |
# Test catsgo.py with clockwork config
# Make a config file for testing server: https://cats.oxfordfun.com
# Run all tests: python3 test_catsgo_clockwork.py
# Run one test: python3 test_catsgo_clockwork.py TestCatsgo.test_fetch
# Run code coverage: coverage run test_catsgo_clockwork.py
# View code coverage report: cove... | [
"unittest.main",
"catsgo.run_info",
"catsgo.fetch",
"catsgo.run_clockwork",
"catsgo.login",
"catsgo.go",
"catsgo.check_run",
"catsgo.load_config"
] | [((1945, 1960), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1958, 1960), False, 'import unittest\n'), ((582, 615), 'catsgo.load_config', 'catsgo.load_config', (['"""config.json"""'], {}), "('config.json')\n", (600, 615), False, 'import catsgo\n'), ((721, 735), 'catsgo.login', 'catsgo.login', ([], {}), '()\n', ... |
import math
import random
import torch
import numpy as np
from scipy.stats import beta
from openmixup.models.utils import batch_shuffle_ddp
def fftfreqnd(h, w=None, z=None):
""" Get bin values for discrete fourier transform of size (h, w, z)
:param h: Required, first dimension size
:param w: Optional, se... | [
"scipy.stats.beta.rvs",
"torch.from_numpy",
"numpy.random.randn",
"math.ceil",
"numpy.fft.irfftn",
"openmixup.models.utils.batch_shuffle_ddp",
"math.floor",
"numpy.expand_dims",
"numpy.ones",
"random.random",
"numpy.fft.fftfreq",
"numpy.linspace",
"numpy.random.permutation",
"torch.no_grad... | [((5484, 5499), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (5497, 5499), False, 'import torch\n'), ((418, 435), 'numpy.fft.fftfreq', 'np.fft.fftfreq', (['h'], {}), '(h)\n', (432, 435), True, 'import numpy as np\n'), ((827, 863), 'numpy.sqrt', 'np.sqrt', (['(fx * fx + fy * fy + fz * fz)'], {}), '(fx * fx + fy *... |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from uw_canvas.models import CanvasCourse
from restclients_core.exceptions import DataFailureException
from canvas_users.dao.canvas import get_course_sections
from canvas_users.exceptions import MissingSectionException
from canvas_u... | [
"canvas_users.dao.canvas.get_course_sections",
"traceback.format_exc",
"uw_canvas.models.CanvasCourse"
] | [((792, 877), 'uw_canvas.models.CanvasCourse', 'CanvasCourse', ([], {'course_id': 'course_id', 'sis_course_id': 'sis_course_id', 'name': 'course_name'}), '(course_id=course_id, sis_course_id=sis_course_id, name=course_name\n )\n', (804, 877), False, 'from uw_canvas.models import CanvasCourse\n'), ((964, 1000), 'canv... |
from algorithms.graph import Tarjan
from algorithms.graph import check_bipartite
from algorithms.graph.dijkstra import Dijkstra
from algorithms.graph import ford_fulkerson
from algorithms.graph import edmonds_karp
from algorithms.graph import dinic
from algorithms.graph import maximum_flow_bfs
from algorithms.graph imp... | [
"algorithms.graph.ford_fulkerson",
"algorithms.graph.edmonds_karp",
"algorithms.graph.maximum_flow_dfs",
"algorithms.graph.check_bipartite",
"algorithms.graph.count_connected_number_of_component.count_components",
"algorithms.graph.dinic",
"algorithms.graph.dijkstra.Dijkstra",
"algorithms.graph.maximu... | [((1072, 1087), 'algorithms.graph.Tarjan', 'Tarjan', (['example'], {}), '(example)\n', (1078, 1087), False, 'from algorithms.graph import Tarjan\n'), ((1620, 1635), 'algorithms.graph.Tarjan', 'Tarjan', (['example'], {}), '(example)\n', (1626, 1635), False, 'from algorithms.graph import Tarjan\n'), ((2320, 2331), 'algor... |
# Generated by Django 3.2.7 on 2021-11-03 19:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('timewebapp', '0081_timewebmodel_has_alerted_due_date_passed_notice'),
]
operations = [
migrations.AddField(
model_name='settings... | [
"django.db.models.CharField"
] | [((385, 525), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('Comfy', 'Comfy'), ('Compact', 'Compact')]", 'default': '"""Comfy"""', 'max_length': '(7)', 'verbose_name': '"""Assignment Spacing"""'}), "(choices=[('Comfy', 'Comfy'), ('Compact', 'Compact')],\n default='Comfy', max_length=7, verbos... |
"""
Compare to nested dictionary/list objects. diff() will return a unix diff like
list of lines of the jsonified object to help locate the differences.
"""
import json
from difflib import HtmlDiff
from json import JSONEncoder
from typing import List, Optional, Type
from .formatter import Formatter
from .list_sorter ... | [
"difflib.HtmlDiff",
"json.dumps"
] | [((2058, 2068), 'difflib.HtmlDiff', 'HtmlDiff', ([], {}), '()\n', (2066, 2068), False, 'from difflib import HtmlDiff\n'), ((2117, 2159), 'json.dumps', 'json.dumps', (['sorted_left'], {'indent': '(2)', 'cls': 'cls'}), '(sorted_left, indent=2, cls=cls)\n', (2127, 2159), False, 'import json\n'), ((2185, 2228), 'json.dumps... |
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import os.path as osp
import cv2
import mmcv
import numpy as np
try:
import imageio
except ImportError:
imageio = None
def parse_args():
parser = argparse.ArgumentParser(
description='Merge images and visualized flow')
parser.ad... | [
"os.path.join",
"numpy.concatenate",
"argparse.ArgumentParser",
"mmcv.scandir"
] | [((226, 297), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Merge images and visualized flow"""'}), "(description='Merge images and visualized flow')\n", (249, 297), False, 'import argparse\n'), ((1182, 1203), 'mmcv.scandir', 'mmcv.scandir', (['img_dir'], {}), '(img_dir)\n', (1194, 1203... |
#!/usr/bin/env python
# Advanced Multi-Mission Operations System (AMMOS) Instrument Toolkit (AIT)
# Bespoke Link to Instruments and Small Satellites (BLISS)
#
# Copyright 2013, by the California Institute of Technology. ALL RIGHTS
# RESERVED. United States Government Sponsorship acknowledged. Any
# commercial use must... | [
"os.path.abspath",
"argparse.ArgumentParser",
"ait.core.seq.Seq",
"ait.core.log.end",
"ait.core.log.begin",
"ait.core.log.warn",
"os.path.splitext",
"ait.core.log.error"
] | [((1085, 1096), 'ait.core.log.begin', 'log.begin', ([], {}), '()\n', (1094, 1096), False, 'from ait.core import gds, log, seq\n'), ((1111, 1214), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__', 'formatter_class': 'argparse.RawDescriptionHelpFormatter'}), '(description=__doc__, form... |
from django.core.management.base import BaseCommand
from dashboard.models import Course, CourseViewOption, AcademicTerms
from dashboard.common.db_util import canvas_id_to_incremented_id
from datetime import datetime
import pytz
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argumen... | [
"dashboard.models.CourseViewOption",
"dashboard.models.Course.objects.get",
"dashboard.models.Course",
"dashboard.common.db_util.canvas_id_to_incremented_id",
"datetime.datetime.strptime",
"dashboard.models.AcademicTerms.objects.get"
] | [((1261, 1299), 'dashboard.common.db_util.canvas_id_to_incremented_id', 'canvas_id_to_incremented_id', (['course_id'], {}), '(course_id)\n', (1288, 1299), False, 'from dashboard.common.db_util import canvas_id_to_incremented_id\n'), ((1363, 1399), 'dashboard.common.db_util.canvas_id_to_incremented_id', 'canvas_id_to_in... |
import random
import requests
from meowbot.triggers import SimpleResponseCommand
from meowbot.conditions import IsCommand
from meowbot.context import CommandContext
from meowbot.util import get_default_zip_code, get_petfinder_api_key
class AdoptCat(SimpleResponseCommand):
condition = IsCommand(["adoptcat"])
... | [
"requests.get",
"meowbot.conditions.IsCommand",
"meowbot.util.get_petfinder_api_key",
"meowbot.util.get_default_zip_code"
] | [((294, 317), 'meowbot.conditions.IsCommand', 'IsCommand', (["['adoptcat']"], {}), "(['adoptcat'])\n", (303, 317), False, 'from meowbot.conditions import IsCommand\n'), ((802, 825), 'meowbot.util.get_petfinder_api_key', 'get_petfinder_api_key', ([], {}), '()\n', (823, 825), False, 'from meowbot.util import get_default_... |
#!/usr/bin/env python3
from setuptools import setup, find_packages
setup(
name='pyworking-cz',
version='0.0.1',
description='Website pyworking.cz',
url='https://github.com/pypa/sampleproject',
license='MIT',
packages=find_packages(exclude=['contrib', 'doc*', 'tests']),
install_requires=[
... | [
"setuptools.find_packages"
] | [((243, 294), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['contrib', 'doc*', 'tests']"}), "(exclude=['contrib', 'doc*', 'tests'])\n", (256, 294), False, 'from setuptools import setup, find_packages\n')] |
from flask import Flask, jsonify, request
from backend.core.blockchain import Blockchain
app = Flask(__name__)
app.config.update(
JSONIFY_PRETTYPRINT_REGULAR=True
)
blk = Blockchain(difficulty=3)
blk.add_node("Finney", 9)
blk.add_node("Szabo", 5)
blk.add_node("Back", 4)
blk.add_node("Nakamoto", 7)
blk.add_node("... | [
"flask.jsonify",
"flask.Flask",
"flask.request.get_json",
"backend.core.blockchain.Blockchain"
] | [((96, 111), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (101, 111), False, 'from flask import Flask, jsonify, request\n'), ((177, 201), 'backend.core.blockchain.Blockchain', 'Blockchain', ([], {'difficulty': '(3)'}), '(difficulty=3)\n', (187, 201), False, 'from backend.core.blockchain import Blockchain... |
import pygame
from pygame.locals import *
import sys
import time
import random
class TypingSpeed:
def __init__(main):
main.width=750
main.height=500
main.input_text=''
main.word = ''
main.reset=True
main.active = False
main.accuracy ... | [
"pygame.quit",
"pygame.draw.rect",
"pygame.display.set_mode",
"pygame.event.get",
"random.choice",
"pygame.init",
"time.sleep",
"time.time",
"pygame.transform.scale",
"pygame.display.update",
"pygame.mouse.get_pos",
"pygame.font.Font",
"pygame.image.load",
"pygame.display.quit",
"pygame.... | [((634, 647), 'pygame.init', 'pygame.init', ([], {}), '()\n', (645, 647), False, 'import pygame\n'), ((673, 701), 'pygame.image.load', 'pygame.image.load', (['"""bg0.jpg"""'], {}), "('bg0.jpg')\n", (690, 701), False, 'import pygame\n'), ((727, 791), 'pygame.transform.scale', 'pygame.transform.scale', (['main.open_img',... |
#!/usr/bin/env python
import tkinter as tk
from scripts.generate import generate_secret
class Application(tk.Tk):
MODES = [
("Words", "Words"),
("Numbers", "Numbers"),
("Mixed", "Mixed"),
]
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
... | [
"tkinter.StringVar",
"tkinter.PhotoImage",
"tkinter.Message",
"tkinter.Tk.__init__",
"tkinter.Button",
"tkinter.Radiobutton",
"tkinter.Label"
] | [((1439, 1480), 'tkinter.PhotoImage', 'tk.PhotoImage', ([], {'file': '"""lock_icon_bkgrd.png"""'}), "(file='lock_icon_bkgrd.png')\n", (1452, 1480), True, 'import tkinter as tk\n'), ((278, 315), 'tkinter.Tk.__init__', 'tk.Tk.__init__', (['self', '*args'], {}), '(self, *args, **kwargs)\n', (292, 315), True, 'import tkint... |
import requests
import time
import random
import traceback
import logging
import os
import gc
header_close = {'Connection': 'keep-alive'}
class autoLogin():
__url = ['http://www.baidu.com','http://cn.bing.com']
__status = -1
__loginUrl = 'http://119.39.119.2'
__initFlag = False
... | [
"requests.session",
"logging.error",
"random.randint",
"logging.basicConfig",
"logging.warning",
"random.choice",
"os.system",
"time.time",
"logging.info",
"gc.collect",
"traceback.format_exc"
] | [((5216, 5275), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': 'LOG_FORMAT'}), '(level=logging.DEBUG, format=LOG_FORMAT)\n', (5235, 5275), False, 'import logging\n'), ((627, 671), 'logging.warning', 'logging.warning', (['"""Object autoLogin deleted!"""'], {}), "('Object autoLogi... |
from rest_framework import viewsets, mixins
from recipe.serializers import TagSerializers
from rest_framework import authentication, permissions
from core.models import Tag
class TagViewSet(viewsets.GenericViewSet, mixins.ListModelMixin):
"""Manage tags in the database"""
authentication_classes = (authenticat... | [
"core.models.Tag.objects.all"
] | [((417, 434), 'core.models.Tag.objects.all', 'Tag.objects.all', ([], {}), '()\n', (432, 434), False, 'from core.models import Tag\n')] |
"""
-----------------------------------------------------------------------------
U N V E R I F I E D S E I S M S
-----------------------------------------------------------------------------
"""
import json
import datetime
from flask import Blueprint, render_template, current_app, redirect, url... | [
"datetime.datetime.strftime",
"main.forms.SeismForm",
"flask.Blueprint",
"json.loads",
"flask.request.args.get",
"flask.flash",
"json.dumps",
"main.forms.USeismsFilterForm",
"main.utilities.api_querying.makeRequest",
"flask.url_for",
"flask.render_template"
] | [((467, 531), 'flask.Blueprint', 'Blueprint', (['"""u_seism"""', '__name__'], {'url_prefix': '"""/unverified-seisms/"""'}), "('u_seism', __name__, url_prefix='/unverified-seisms/')\n", (476, 531), False, 'from flask import Blueprint, render_template, current_app, redirect, url_for, request, flash\n'), ((721, 776), 'mai... |
import os
from hazelcast.predicate import (
equal,
and_,
between,
less,
less_or_equal,
greater,
greater_or_equal,
or_,
not_equal,
not_,
like,
ilike,
regex,
sql,
true,
false,
in_,
instance_of,
paging,
)
from hazelcast.serialization.api import P... | [
"tests.integration.backward_compatible.util.write_string_to_writer",
"os.path.join",
"hazelcast.predicate.between",
"hazelcast.predicate.less",
"hazelcast.predicate.not_equal",
"os.path.dirname",
"hazelcast.predicate.true",
"hazelcast.predicate.like",
"hazelcast.predicate.ilike",
"hazelcast.predic... | [((1487, 1511), 'hazelcast.predicate.sql', 'sql', (['"""this == \'value-1\'"""'], {}), '("this == \'value-1\'")\n', (1490, 1511), False, 'from hazelcast.predicate import equal, and_, between, less, less_or_equal, greater, greater_or_equal, or_, not_equal, not_, like, ilike, regex, sql, true, false, in_, instance_of, pa... |
from server.methods.transaction import Transaction
from server import utils
from server import cache
import config
class Block():
@classmethod
def height(cls, height: int):
data = utils.make_request('getblockhash', [height])
if data['error'] is None:
txid = data['result']
data.pop('result')
data['resul... | [
"server.methods.transaction.Transaction",
"server.utils.make_request",
"server.cache.memoize"
] | [((715, 750), 'server.cache.memoize', 'cache.memoize', ([], {'timeout': 'config.cache'}), '(timeout=config.cache)\n', (728, 750), False, 'from server import cache\n'), ((1478, 1513), 'server.cache.memoize', 'cache.memoize', ([], {'timeout': 'config.cache'}), '(timeout=config.cache)\n', (1491, 1513), False, 'from server... |
#!/usr/bin/env python
# Copyright 2017 Palo Alto Networks, 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... | [
"pandevice.objects.ServiceObject.refreshall",
"ipaddress.ip_network",
"pandevice.objects.ServiceGroup.refreshall",
"pandevice.policies.PreRulebase",
"ipaddress.ip_address",
"pandevice.policies.SecurityRule.refreshall",
"json.dumps",
"pandevice.objects.Tag.refreshall",
"pandevice.objects.AddressGroup... | [((5425, 5467), 'pandevice.policies.SecurityRule.refreshall', 'policies.SecurityRule.refreshall', (['rulebase'], {}), '(rulebase)\n', (5457, 5467), False, 'from pandevice import policies\n'), ((6243, 6269), 'ipaddress.ip_address', 'ipaddress.ip_address', (['addr'], {}), '(addr)\n', (6263, 6269), False, 'import ipaddres... |
#
# Copyright(c) 2019 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
import pytest
from api.cas import casadm
from api.cas.cache_config import CacheMode
from core.test_run import TestRun
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
from test_tools.dd import Dd
from tes... | [
"storage_devices.disk.DiskTypeLowerThan",
"storage_devices.disk.DiskTypeSet",
"core.test_run.TestRun.LOGGER.info",
"api.cas.casadm.start_cache",
"test_utils.size.Size",
"test_tools.dd.Dd"
] | [((952, 989), 'core.test_run.TestRun.LOGGER.info', 'TestRun.LOGGER.info', (['"""Stopping cache"""'], {}), "('Stopping cache')\n", (971, 989), False, 'from core.test_run import TestRun\n'), ((1012, 1063), 'core.test_run.TestRun.LOGGER.info', 'TestRun.LOGGER.info', (['"""Removing one of core devices"""'], {}), "('Removin... |
import json
from django.contrib.auth.views import LoginView, LogoutView
from django.views.generic import TemplateView
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth import authenticate, login, logout
from django.http.response import JsonResponse, HttpResponseRedirect
from django.url... | [
"django.contrib.auth.models.User.objects.get",
"django.http.response.JsonResponse",
"django.db.models.Q",
"django.urls.reverse",
"django.contrib.auth.logout",
"django.contrib.auth.authenticate",
"django.contrib.auth.login"
] | [((1934, 1979), 'django.http.response.JsonResponse', 'JsonResponse', (['data'], {'safe': '(False)', 'status': 'status'}), '(data, safe=False, status=status)\n', (1946, 1979), False, 'from django.http.response import JsonResponse, HttpResponseRedirect\n'), ((2142, 2163), 'django.urls.reverse', 'reverse', (['"""core:logi... |
# Copyright 2016 The TensorFlow 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 applica... | [
"tensorflow.python.ops.array_ops.where",
"tensorflow.python.ops.array_ops.reshape",
"six.add_metaclass",
"tensorflow.python.ops.distributions.categorical.Categorical",
"tensorflow.python.util.nest.map_structure",
"tensorflow.python.ops.random_ops.random_uniform",
"tensorflow.python.ops.array_ops.shape",... | [((2375, 2405), 'six.add_metaclass', 'six.add_metaclass', (['abc.ABCMeta'], {}), '(abc.ABCMeta)\n', (2392, 2405), False, 'import six\n'), ((19254, 19330), 'tensorflow.python.framework.ops.convert_to_tensor', 'ops.convert_to_tensor', (['start_tokens'], {'dtype': 'dtypes.int32', 'name': '"""start_tokens"""'}), "(start_to... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: tshzzz
"""
import numpy as np
import torch
from src.utils import py_cpu_nms,bbox_iou
def gen_yolo_box(featmaps,anchor_wh):
#featmaps = [b,c,h,w]
output = np.zeros((featmaps[0], featmaps[1], len(anchor_wh), 4))
for i in range(featmaps[0]):
... | [
"numpy.zeros",
"torch.cat",
"numpy.argsort",
"torch.exp",
"torch.Tensor",
"numpy.array",
"src.utils.py_cpu_nms",
"src.utils.bbox_iou"
] | [((936, 1027), 'numpy.zeros', 'np.zeros', (['(self.featmap_size[0], self.featmap_size[1], self.boxes_num, self.class_num)'], {}), '((self.featmap_size[0], self.featmap_size[1], self.boxes_num, self.\n class_num))\n', (944, 1027), True, 'import numpy as np\n'), ((1039, 1112), 'numpy.zeros', 'np.zeros', (['(self.featm... |
#!/usr/bin/env python3
# Copyright 2018 ckb-next Development Team <<EMAIL>>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above... | [
"re.compile"
] | [((2053, 2091), 're.compile', 're.compile', (["b'P\\x00[0x]\\x00[0-9x]\\x00'"], {}), "(b'P\\x00[0x]\\x00[0-9x]\\x00')\n", (2063, 2091), False, 'import re\n')] |
from flask import current_app, render_template
from flask_mail import Message
# Code from
# https://github.com/lingthio/Flask-User/blob/master/flask_user/emails.py
def render_email(filename, **kwargs):
"""
Render email message in HTML and raw format
"""
html_message = render_template(filename + '.htm... | [
"flask.current_app.extensions.get",
"flask.current_app.config.get",
"flask.render_template"
] | [((288, 333), 'flask.render_template', 'render_template', (["(filename + '.html')"], {}), "(filename + '.html', **kwargs)\n", (303, 333), False, 'from flask import current_app, render_template\n'), ((353, 397), 'flask.render_template', 'render_template', (["(filename + '.txt')"], {}), "(filename + '.txt', **kwargs)\n",... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | [
"magnum.db.sqlalchemy.api.model_query",
"oslo_utils.uuidutils.generate_uuid"
] | [((1005, 1030), 'oslo_utils.uuidutils.generate_uuid', 'uuidutils.generate_uuid', ([], {}), '()\n', (1028, 1030), False, 'from oslo_utils import uuidutils\n'), ((1365, 1390), 'oslo_utils.uuidutils.generate_uuid', 'uuidutils.generate_uuid', ([], {}), '()\n', (1388, 1390), False, 'from oslo_utils import uuidutils\n'), ((2... |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
from aws_cdk import (
aws_iam as iam,
# aws_lambda as _lambda,
# aws_sagemaker as sm,
core
)
import os
ROLE_NAME_PREFIX = os.environ["ROLE_NAME_PREFIX"]
class SageMakerStudioStack(core.Stack):
def __init__(se... | [
"aws_cdk.core.CfnParameter",
"aws_cdk.aws_iam.ManagedPolicy.from_aws_managed_policy_name",
"aws_cdk.core.CfnResource",
"aws_cdk.core.Fn.condition_equals",
"aws_cdk.aws_iam.ServicePrincipal",
"aws_cdk.core.Fn.condition_if"
] | [((472, 743), 'aws_cdk.core.CfnParameter', 'core.CfnParameter', (['self', '"""StudioAuthentication"""'], {'type': '"""String"""', 'description': '"""Authentication method for SageMaker Studio."""', 'allowed_values': "['AWS IAM with IAM users', 'AWS IAM with AWS account federation (external IdP)'\n ]", 'default': '""... |
from brownie import FundMe, network, config, MockV3Aggregator
from scripts.utils import get_account, deploy_mock_priceFeed, LOCAL_BLOCKCHAIN_ENV
from scripts.fund_and_withdraw import fund, withdraw
from web3 import Web3
def deploy_fund_me():
account = get_account()
# After the changes in the contract's cons... | [
"scripts.utils.deploy_mock_priceFeed",
"brownie.FundMe.deploy",
"scripts.fund_and_withdraw.fund",
"scripts.fund_and_withdraw.withdraw",
"scripts.utils.get_account",
"brownie.network.show_active"
] | [((260, 273), 'scripts.utils.get_account', 'get_account', ([], {}), '()\n', (271, 273), False, 'from scripts.utils import get_account, deploy_mock_priceFeed, LOCAL_BLOCKCHAIN_ENV\n'), ((531, 552), 'brownie.network.show_active', 'network.show_active', ([], {}), '()\n', (550, 552), False, 'from brownie import FundMe, net... |
"""The SSDP integration."""
import asyncio
from datetime import timedelta
import logging
from urllib.parse import urlparse
import aiohttp
from defusedxml import ElementTree
from netdisco import ssdp, util
from homeassistant.helpers.event import async_track_time_interval
from homeassistant.generated.ssdp import SSDP
... | [
"asyncio.gather",
"homeassistant.generated.ssdp.SSDP.items",
"logging.getLogger",
"netdisco.util.etree_to_dict",
"datetime.timedelta",
"homeassistant.helpers.event.async_track_time_interval",
"asyncio.wait",
"urllib.parse.urlparse",
"defusedxml.ElementTree.fromstring"
] | [((352, 373), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(60)'}), '(seconds=60)\n', (361, 373), False, 'from datetime import timedelta\n'), ((780, 807), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (797, 807), False, 'import logging\n'), ((4686, 4710), 'urllib.parse.urlparse',... |
"""Test functions for datetime_utils.py.
"""
from datetime import datetime
from aracnid_utils.datetime_utils import isoweek, fromisoweek
# initialize module variables
REF_ISO_WEEK = '2020-W25'
REF_WEEK_DATE1 = '2020-06-15T00:00:00-04:00'
REF_WEEK_DATE2 = '2020-06-21T23:59:59-04:00'
REF_WEEK_DATE3 = '2020-06-22T00:00:... | [
"aracnid_utils.datetime_utils.isoweek",
"datetime.datetime.fromisoformat",
"aracnid_utils.datetime_utils.fromisoweek"
] | [((464, 502), 'datetime.datetime.fromisoformat', 'datetime.fromisoformat', (['REF_WEEK_DATE1'], {}), '(REF_WEEK_DATE1)\n', (486, 502), False, 'from datetime import datetime\n'), ((518, 536), 'aracnid_utils.datetime_utils.isoweek', 'isoweek', (['week_date'], {}), '(week_date)\n', (525, 536), False, 'from aracnid_utils.d... |
from django.db.models.expressions import F
from .filters import *
from . models import *
from .parsers import *
from .permissions import *
from .serializers import *
import csv
import datetime
from django.conf import settings
from django.core.files.base import ContentFile
from django.core.files.storage import default_... | [
"os.remove",
"shutil.unpack_archive",
"csv.writer",
"django.http.HttpResponse",
"shutil.make_archive",
"shutil.rmtree",
"django.utils.timezone.now",
"os.path.exists",
"datetime.date.today",
"rest_framework.exceptions.PermissionDenied",
"django.shortcuts.get_object_or_404",
"rest_framework.resp... | [((1670, 1725), 'rest_framework.exceptions.PermissionDenied', 'PermissionDenied', (['"""New password cannot be old password"""'], {}), "('New password cannot be old password')\n", (1686, 1725), False, 'from rest_framework.exceptions import PermissionDenied\n'), ((4724, 4753), 'rest_framework.response.Response', 'Respon... |
from functools import partial
import albumentations as A
import cv2
import matplotlib.pyplot as plt
import tensorflow as tf
from watch_recognition.targets_encoding import (
add_sample_weights,
encode_keypoints_to_angle,
encode_keypoints_to_mask,
set_shapes,
set_shapes_with_sample_weight,
)
EMPTY_... | [
"functools.partial",
"albumentations.ISONoise",
"albumentations.InvertImg",
"albumentations.RGBShift",
"albumentations.RandomSizedCrop",
"tensorflow.data.Dataset.from_tensor_slices",
"albumentations.HueSaturationValue",
"albumentations.RandomBrightnessContrast",
"tensorflow.cast",
"albumentations.... | [((3463, 3490), 'tensorflow.cast', 'tf.cast', (['aug_kp', 'tf.float32'], {}), '(aug_kp, tf.float32)\n', (3470, 3490), True, 'import tensorflow as tf\n'), ((3773, 3800), 'tensorflow.cast', 'tf.cast', (['aug_kp', 'tf.float32'], {}), '(aug_kp, tf.float32)\n', (3780, 3800), True, 'import tensorflow as tf\n'), ((4056, 4085)... |
# aoc.py
from typing import List
from itertools import tee, islice
from collections import deque
def input_as_string(filename:str) -> str:
"""returns the content of the input file as a string"""
with open(filename, encoding="utf-8") as file:
return file.read().rstrip("\n")
def input_as_lines(filename:... | [
"itertools.tee",
"itertools.islice"
] | [((854, 867), 'itertools.tee', 'tee', (['iterable'], {}), '(iterable)\n', (857, 867), False, 'from itertools import tee, islice\n'), ((1027, 1049), 'itertools.islice', 'islice', (['iterable', 'size'], {}), '(iterable, size)\n', (1033, 1049), False, 'from itertools import tee, islice\n')] |
#plots.py
import os
import pandas
import numpy as np
import matplotlib.pyplot as plt
#plots.py
# . . .
def plot_lines(df, linewidth = 1, figsize = (40,20),secondary_y = None, legend=True, pp = None, save_fig = False):
fig, ax = plt.subplots(figsize = figsize)
# If no secondary_y (axis), plot all vari... | [
"matplotlib.pyplot.title",
"os.mkdir",
"matplotlib.pyplot.show",
"matplotlib.pyplot.close",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.rcParams.update",
"numpy.arange",
"matplotlib.pyplot.cm.colors.Normalize",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savef... | [((239, 268), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': 'figsize'}), '(figsize=figsize)\n', (251, 268), True, 'import matplotlib.pyplot as plt\n'), ((2829, 2859), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(20, 20)'}), '(figsize=(20, 20))\n', (2841, 2859), True, 'import matplot... |
from django.db import models
# Create your models here.
class Switch(models.Model):
brand = models.CharField(max_length=50)
model = models.CharField(max_length=50)
type = models.CharField(max_length=50, null=True)
actuation_distance = models.DecimalField(max_digits=5, decimal_places=2)
bottom_di... | [
"django.db.models.CharField",
"django.db.models.DecimalField",
"django.db.models.IntegerField",
"django.db.models.FileField"
] | [((98, 129), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)'}), '(max_length=50)\n', (114, 129), False, 'from django.db import models\n'), ((142, 173), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)'}), '(max_length=50)\n', (158, 173), False, 'from django.db imp... |
import numpy as np
import pytest
import astropy
import astropy.units as u
from astropy.tests.helper import quantity_allclose, assert_quantity_allclose
from astropy.coordinates import (SkyCoord, get_body_barycentric, Angle,
ConvertError, Longitude, CartesianRepresentation,
... | [
"astropy.coordinates.Longitude",
"numpy.arctan2",
"astropy.coordinates.get_body_barycentric_posvel",
"sunpy.coordinates.HeliocentricInertial",
"sunpy.coordinates.Heliocentric",
"pytest.mark.skipif",
"astropy.coordinates.CartesianRepresentation",
"sunpy.coordinates.transformations.transform_with_sun_ce... | [((22357, 22451), 'pytest.mark.skipif', 'pytest.mark.skipif', (["(astropy.__version__ < '3.2.0')"], {'reason': '"""Not supported by Astropy <3.2"""'}), "(astropy.__version__ < '3.2.0', reason=\n 'Not supported by Astropy <3.2')\n", (22375, 22451), False, 'import pytest\n'), ((33417, 33480), 'pytest.mark.parametrize'... |
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
import copy
import awkward as ak
from awkward._v2.contents.content import Content
from awkward._v2.forms.unmaskedform import UnmaskedForm
from awkward._v2.forms.form import _parameters_equal
np = ak.nplike.NumpyMetadata.instance(... | [
"awkward._v2._typetracer.TypeTracer.instance",
"awkward._v2._util.isint",
"awkward._v2.operations.to_numpy",
"awkward._v2._util.merge_parameters",
"awkward._util.isstr",
"awkward._v2.index.Index64",
"copy.copy",
"awkward._v2.contents.RegularArray",
"awkward._v2.contents.bytemaskedarray.ByteMaskedArr... | [((287, 321), 'awkward.nplike.NumpyMetadata.instance', 'ak.nplike.NumpyMetadata.instance', ([], {}), '()\n', (319, 321), True, 'import awkward as ak\n'), ((1518, 1558), 'awkward._v2._typetracer.TypeTracer.instance', 'ak._v2._typetracer.TypeTracer.instance', ([], {}), '()\n', (1556, 1558), True, 'import awkward as ak\n'... |
import yaml
import datetime
import re
from .transaction import Transaction
class Block(yaml.YAMLObject):
yaml_tag = u'!Block'
miner_re = re.compile(r'^[0-9a-zA-Z]{3,32}$')
def __repr__(self):
return "%s(Timestamp=%r, Difficulty=%r, Nonce=%r, Miner=%r, Transactions=[%d])" % (
self.__class__.__name__,
self... | [
"re.compile"
] | [((142, 175), 're.compile', 're.compile', (['"""^[0-9a-zA-Z]{3,32}$"""'], {}), "('^[0-9a-zA-Z]{3,32}$')\n", (152, 175), False, 'import re\n')] |
import os
import argparse
import time
import dgl
from dgl.contrib import KVServer
import torch as th
from train_pytorch import load_model
from dataloader import get_server_partition_dataset
NUM_THREAD = 1 # Fix the number of threads to 1 on kvstore
class KGEServer(KVServer):
"""User-defined kvstore for DGL-KG... | [
"torch.set_num_threads",
"train_pytorch.load_model",
"dgl.contrib.read_ip_config",
"dataloader.get_server_partition_dataset"
] | [((4184, 4271), 'dataloader.get_server_partition_dataset', 'get_server_partition_dataset', (['args.data_path', 'args.dataset', 'args.format', 'machine_id'], {}), '(args.data_path, args.dataset, args.format,\n machine_id)\n', (4212, 4271), False, 'from dataloader import get_server_partition_dataset\n'), ((4460, 4523)... |