code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""This file sets up the package"""
from setuptools import setup
setup(
name='wotw-cookiecutter-base',
version='0.2.0',
packages=[],
)
| [
"setuptools.setup"
] | [((67, 133), 'setuptools.setup', 'setup', ([], {'name': '"""wotw-cookiecutter-base"""', 'version': '"""0.2.0"""', 'packages': '[]'}), "(name='wotw-cookiecutter-base', version='0.2.0', packages=[])\n", (72, 133), False, 'from setuptools import setup\n')] |
import yaml
from collections import UserDict
from rebuild_tool.exceptions import IncompleteMetadataException, UnknownPluginException
from rebuild_tool.builder_plugins.builder_loader import available_builder_plugins
from rebuild_tool.pkg_source_plugins.pkg_source_loader import available_pkg_source_plugins
def get_file... | [
"yaml.load",
"rebuild_tool.exceptions.IncompleteMetadataException"
] | [((821, 841), 'yaml.load', 'yaml.load', (['yaml_data'], {}), '(yaml_data)\n', (830, 841), False, 'import yaml\n'), ((2681, 2703), 'yaml.load', 'yaml.load', (['recipe_data'], {}), '(recipe_data)\n', (2690, 2703), False, 'import yaml\n'), ((1998, 2112), 'rebuild_tool.exceptions.IncompleteMetadataException', 'IncompleteMe... |
# -*- coding: utf-8 -*-
import os, sys
import shutil
import tissueloc as tl
from tissueloc.load_slide import load_slide_img, select_slide_level
import numpy as np
from skimage import io, color
import cv2
if __name__ == "__main__":
slide_dir = "../data/TestSlides/Malignant"
save_dir = "../data/TestSlides/Mal... | [
"os.makedirs",
"tissueloc.load_slide.load_slide_img",
"numpy.ascontiguousarray",
"os.path.exists",
"cv2.drawContours",
"os.path.splitext",
"tissueloc.load_slide.select_slide_level",
"shutil.rmtree",
"os.path.join",
"os.listdir",
"tissueloc.locate_tissue_cnts"
] | [((342, 366), 'os.path.exists', 'os.path.exists', (['save_dir'], {}), '(save_dir)\n', (356, 366), False, 'import os, sys\n'), ((404, 425), 'os.makedirs', 'os.makedirs', (['save_dir'], {}), '(save_dir)\n', (415, 425), False, 'import os, sys\n'), ((376, 399), 'shutil.rmtree', 'shutil.rmtree', (['save_dir'], {}), '(save_d... |
from dataclasses import dataclass
from typing import List, Optional
from erica.erica_legacy.elster_xml.common.basic_xml_data_representation import ENutzdaten, construct_basic_xml_data_representation
from erica.erica_legacy.elster_xml.grundsteuer.elster_eigentuemer import EAngFeststellung, EPersonData, EEigentumsverh, ... | [
"erica.erica_legacy.elster_xml.grundsteuer.elster_eigentuemer.EAngFeststellung",
"erica.erica_legacy.elster_xml.grundsteuer.elster_eigentuemer.EEigentumsverh",
"erica.erica_legacy.elster_xml.grundsteuer.elster_gebaeude.EAngWohn",
"erica.erica_legacy.elster_xml.grundsteuer.elster_eigentuemer.EEmpfangsbevollmae... | [((3915, 4094), 'erica.erica_legacy.elster_xml.common.basic_xml_data_representation.construct_basic_xml_data_representation', 'construct_basic_xml_data_representation', ([], {'empfaenger_id': '"""F"""', 'empfaenger_text': '"""1121"""', 'nutzdaten_object': 'grundsteuer_elster_data_representation', 'nutzdaten_header_vers... |
#! /usr/bin/env python
"""Run a YOLO_v2 style detection model on test images."""
import argparse
import colorsys
import imghdr
import os
import random
import numpy as np
from keras import backend as K
from keras.models import load_model
from PIL import Image, ImageDraw, ImageFont
from yad2k.models.keras_yolo import y... | [
"keras.models.load_model",
"keras.backend.placeholder",
"os.mkdir",
"os.makedirs",
"colorsys.hsv_to_rgb",
"keras.backend.learning_phase",
"keras.backend.get_session",
"random.shuffle",
"numpy.floor",
"os.path.exists",
"numpy.expand_dims",
"yad2k.models.keras_yolo.yolo_eval",
"random.seed",
... | [((1317, 1339), 'keras.models.load_model', 'load_model', (['model_path'], {}), '(model_path)\n', (1327, 1339), False, 'from keras.models import load_model\n'), ((2427, 2445), 'random.seed', 'random.seed', (['(10101)'], {}), '(10101)\n', (2438, 2445), False, 'import random\n'), ((2499, 2521), 'random.shuffle', 'random.s... |
import random
from collections import deque
import numpy as np
from keras.layers import Dense
from keras.models import Sequential
from keras.optimizers import Adam
class DQNAgent:
def __init__(self, state_size,
action_size,
memory_size,
hidden_layers_number,
... | [
"numpy.argmax",
"random.sample",
"keras.optimizers.Adam",
"keras.layers.Dense",
"numpy.array",
"random.randrange",
"numpy.random.rand",
"keras.models.Sequential",
"collections.deque"
] | [((721, 746), 'collections.deque', 'deque', ([], {'maxlen': 'memory_size'}), '(maxlen=memory_size)\n', (726, 746), False, 'from collections import deque\n'), ((1271, 1283), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (1281, 1283), False, 'from keras.models import Sequential\n'), ((2019, 2069), 'random.sa... |
import sys
import greentest
import gevent
from gevent.hub import get_hub
def raise_(ex):
raise ex
MSG = 'should be re-raised and caught'
class Test(greentest.TestCase):
error_fatal = False
def test_sys_exit(self):
self.start(sys.exit, MSG)
try:
gevent.sleep(0.001)
... | [
"greentest.main",
"gevent.hub.get_hub",
"gevent.spawn",
"gevent.sleep"
] | [((1554, 1570), 'greentest.main', 'greentest.main', ([], {}), '()\n', (1568, 1570), False, 'import greentest\n'), ((1135, 1154), 'gevent.sleep', 'gevent.sleep', (['(0.001)'], {}), '(0.001)\n', (1147, 1154), False, 'import gevent\n'), ((1389, 1409), 'gevent.sleep', 'gevent.sleep', (['(0.0001)'], {}), '(0.0001)\n', (1401... |
"""
Test espei.utils classes and functions.
"""
import pickle
from tinydb import where
from espei.utils import ImmediateClient, PickleableTinyDB, MemoryStorage, \
flexible_open_string, add_bibtex_to_bib_database, bib_marker_map
from .fixtures import datasets_db, tmp_file
from .testing_data import CU_MG_TDB
MULTI... | [
"espei.utils.add_bibtex_to_bib_database",
"espei.utils.PickleableTinyDB",
"espei.utils.bib_marker_map",
"distributed.LocalCluster",
"tinydb.where",
"espei.utils.flexible_open_string",
"pickle.dumps"
] | [((1467, 1506), 'espei.utils.PickleableTinyDB', 'PickleableTinyDB', ([], {'storage': 'MemoryStorage'}), '(storage=MemoryStorage)\n', (1483, 1506), False, 'from espei.utils import ImmediateClient, PickleableTinyDB, MemoryStorage, flexible_open_string, add_bibtex_to_bib_database, bib_marker_map\n'), ((1790, 1835), 'espei... |
import mnist_loader
import network
training_data, validation_data, test_data = mnist_loader.load_data_wrapper()
# print("training data")
# print(type(training_data))
# print(len(training_data))
# print(training_data[0][0].shape)
# print(training_data[0][1].shape)
net = network.Network([784, 30, 10])
net.SGD(training_... | [
"network.Network",
"mnist_loader.load_data_wrapper"
] | [((80, 112), 'mnist_loader.load_data_wrapper', 'mnist_loader.load_data_wrapper', ([], {}), '()\n', (110, 112), False, 'import mnist_loader\n'), ((272, 302), 'network.Network', 'network.Network', (['[784, 30, 10]'], {}), '([784, 30, 10])\n', (287, 302), False, 'import network\n')] |
############################
# Libraries used as plugins
############################
# try:
# import katana as _
# has_katana = True
# except ImportError:
# has_katana = False
import metagraph
# Use this as the entry_point object
registry = metagraph.PluginRegistry("metagraph_katana")
def find_plugi... | [
"metagraph.PluginRegistry"
] | [((259, 303), 'metagraph.PluginRegistry', 'metagraph.PluginRegistry', (['"""metagraph_katana"""'], {}), "('metagraph_katana')\n", (283, 303), False, 'import metagraph\n')] |
import sys
sys.path.insert(0, '../')
import warnings
warnings.simplefilter('ignore')
from get_config import get_config
from utils import fix_seed, rle2mask, mask2rle
from models import build_model
from utils_inference import get_pred_mask, get_rle
from get_fold_idxs_list import get_fold_idxs_list
import numpy as np
... | [
"os.makedirs",
"warnings.simplefilter",
"torch.load",
"sys.path.insert",
"utils_inference.get_rle",
"models.build_model",
"get_fold_idxs_list.get_fold_idxs_list",
"utils_inference.get_pred_mask",
"os.path.join",
"get_config.get_config",
"utils.fix_seed"
] | [((12, 37), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../"""'], {}), "(0, '../')\n", (27, 37), False, 'import sys\n'), ((55, 86), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""'], {}), "('ignore')\n", (76, 86), False, 'import warnings\n'), ((514, 528), 'utils.fix_seed', 'fix_seed', (['(2021)... |
# coding=utf-8
# Copyright 2021 <NAME> and the HuggingFace Inc. team.
#
# 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... | [
"os.path.abspath",
"os.path.isdir",
"collections.defaultdict",
"shutil.copyfile",
"os.path.join"
] | [((9077, 9094), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (9088, 9094), False, 'from collections import defaultdict\n'), ((12786, 12904), 'os.path.join', 'os.path.join', (['save_directory', "((filename_prefix + '-' if filename_prefix else '') + VOCAB_FILES_NAMES[\n 'vocab_file'])"], {}), ... |
#!/usr/bin/env python
from ansible.module_utils.basic import *
import requests
import os
from dnsimple import DNSimple
'''
parameters:
api_token DNSimple token for account
account_id DNSimple account id
domain Zone from DNSimple
record JSON object, includes type, name, content, ttl
exampl... | [
"dnsimple.DNSimple"
] | [((664, 743), 'dnsimple.DNSimple', 'DNSimple', ([], {'api_token': "data['dnsimple_token']", 'account_id': "data['dnsimple_account']"}), "(api_token=data['dnsimple_token'], account_id=data['dnsimple_account'])\n", (672, 743), False, 'from dnsimple import DNSimple\n'), ((1332, 1411), 'dnsimple.DNSimple', 'DNSimple', ([],... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=module-missing-docstring,class-missing-docstring
from __future__ import print_function
... | [
"json.loads",
"os.path.dirname",
"chromite.lib.osutils.ReadFile",
"cros_config_test_schema.TransformConfig",
"libcros_schema.GetNamedTuple",
"chromite.lib.cros_test_lib.main",
"cros_config_test_schema.ParseArgs",
"os.path.join"
] | [((1258, 1283), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1273, 1283), False, 'import os\n'), ((4972, 5007), 'chromite.lib.cros_test_lib.main', 'cros_test_lib.main', ([], {'module': '__name__'}), '(module=__name__)\n', (4990, 5007), False, 'from chromite.lib import cros_test_lib\n'), ((... |
"""
Copyright (c) 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
from dockerfile_parse import DockerfileParser
from atomic_reactor.plugin import PluginFailedExcepti... | [
"atomic_reactor.util.ImageName",
"flexmock.flexmock",
"tests.docker_mock.mock_docker",
"atomic_reactor.inner.DockerBuildWorkflow",
"pytest.raises",
"pytest.mark.parametrize"
] | [((1671, 1722), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""is_failed"""', '[True, False]'], {}), "('is_failed', [True, False])\n", (1694, 1722), False, 'import pytest\n'), ((1823, 1871), 'flexmock.flexmock', 'flexmock', (['DockerfileParser'], {'content': '"""df_content"""'}), "(DockerfileParser, conten... |
# Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"mindspore.ops.Concat",
"mindspore.nn.Range",
"mindspore.ops.Floor",
"mindspore.ops.ExpandDims",
"mindspore.nn.Conv2d",
"mindspore.nn.LeakyReLU",
"mindspore.ops.Unstack",
"mindspore.ops.ResizeBilinear",
"mindspore.ops.clip_by_value",
"mindspore.ops.Shape",
"mindspore.nn.CellList",
"mindspore.o... | [((1125, 1299), 'mindspore.nn.Conv2d', 'nn.Conv2d', (['in_planes', 'out_planes'], {'kernel_size': 'kernel_size', 'stride': 'stride', 'dilation': 'dilation', 'padding': '((kernel_size - 1) * dilation // 2)', 'has_bias': '(True)', 'pad_mode': '"""pad"""'}), "(in_planes, out_planes, kernel_size=kernel_size, stride=stride,... |
import time
import random
import json
import re
import requests
import lxml.html
RATINGS = ['Funny', 'Confusing', 'Unconvincing', 'Informative', 'Fascinating',
'Persuasive', 'Obnoxious', 'Courageous', 'Beautiful', 'Longwinded',
'Inspiring', 'Ingenious', 'Jaw-dropping', 'OK']
LECTION_TOPICS_REGEX ... | [
"re.search",
"random.randint",
"json.dumps",
"re.compile"
] | [((322, 375), 're.compile', 're.compile', (['"""<meta content="(.+)" name="keywords" />"""'], {}), '(\'<meta content="(.+)" name="keywords" />\')\n', (332, 375), False, 'import re\n'), ((1439, 1476), 're.search', 're.search', (['LECTION_TOPICS_REGEX', 'html'], {}), '(LECTION_TOPICS_REGEX, html)\n', (1448, 1476), False,... |
import sys, random, math, pygame
from pygame import locals
from datetime import datetime, time, date
# main program begins
pygame.init()
screen = pygame.display.set_mode((600, 500))
pygame.display.set_caption("Analog Clock")
font = pygame.font.Font(None, 36)
orange = 220, 180, 0
white = 255, 255, 255
yellow = 255, 25... | [
"pygame.draw.line",
"pygame.draw.circle",
"datetime.datetime.today",
"pygame.event.get",
"pygame.display.set_mode",
"math.radians",
"pygame.init",
"math.sin",
"pygame.display.update",
"math.cos",
"pygame.font.Font",
"pygame.display.set_caption",
"pygame.key.get_pressed",
"sys.exit"
] | [((124, 137), 'pygame.init', 'pygame.init', ([], {}), '()\n', (135, 137), False, 'import sys, random, math, pygame\n'), ((147, 182), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(600, 500)'], {}), '((600, 500))\n', (170, 182), False, 'import sys, random, math, pygame\n'), ((183, 225), 'pygame.display.set_ca... |
import pytest
from _cob import mymodels
@pytest.fixture
def people():
people = []
for _ in range(10):
person = mymodels.Person(first_name="First", last_name="Last")
people.append(person)
mymodels.db.session.add(person)
mymodels.db.session.commit()
yield people
for person in... | [
"_cob.mymodels.db.session.commit",
"_cob.mymodels.db.session.delete",
"_cob.mymodels.Person",
"_cob.mymodels.db.session.add"
] | [((257, 285), '_cob.mymodels.db.session.commit', 'mymodels.db.session.commit', ([], {}), '()\n', (283, 285), False, 'from _cob import mymodels\n'), ((376, 404), '_cob.mymodels.db.session.commit', 'mymodels.db.session.commit', ([], {}), '()\n', (402, 404), False, 'from _cob import mymodels\n'), ((129, 182), '_cob.mymode... |
'''
main.py
Created by <NAME> on 2020
Copyright © 2020 <NAME>. All rights reserved.
'''
import sys
a, b= map(int, sys.stdin.readline().rstrip().split(' '))
print(a * b) | [
"sys.stdin.readline"
] | [((133, 153), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (151, 153), False, 'import sys\n')] |
#!/usr/bin/env python
"""
Fraunhofer IML
Department Automation and Embedded Systems
Tabsize : 4
Charset : UTF-8
"""
__author__ = "<NAME>"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
from abc import ABCMeta, abstractmethod
import xml.etree.ElementTree
from MARSVertex import MARSVe... | [
"rospy.logwarn",
"mars_common.Id.Id"
] | [((3166, 3210), 'mars_common.Id.Id', 'Id', (['uuid', 'uuid_type'], {'description': 'vertex_name'}), '(uuid, uuid_type, description=vertex_name)\n', (3168, 3210), False, 'from mars_common.Id import Id, IdType\n'), ((3280, 3346), 'mars_common.Id.Id', 'Id', (['self.__id', 'IdType.ID_TYPE_STRING_NAME'], {'description': 've... |
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
from collections import OrderedDict
import gc
from current_clamp import *
from current_clamp_features import extract_istep_features
from visualization.feature_annotations import feature_name_dict
from read_metadata i... | [
"os.mkdir",
"current_clamp_features.extract_istep_features",
"PIL.Image.new",
"matplotlib.pyplot.show",
"matplotlib.pyplot.close",
"os.path.exists",
"file_io.load_current_step",
"pandas.isnull",
"pandas.read_excel",
"gc.collect",
"collections.OrderedDict",
"os.path.join"
] | [((19670, 19726), 'os.path.join', 'os.path.join', (['directory', "key['experiment']", "(rec + '.abf')"], {}), "(directory, key['experiment'], rec + '.abf')\n", (19682, 19726), False, 'import os\n'), ((19742, 19787), 'file_io.load_current_step', 'load_current_step', (['abf_file'], {'min_voltage': '(-140)'}), '(abf_file,... |
from pyformance.meters import Meter
from tests import TimedTestCase
class MeterTestCase(TimedTestCase):
def setUp(self):
super(MeterTestCase, self).setUp()
self.meter = Meter(key="test_meter", clock=TimedTestCase.clock)
def tearDown(self):
super(MeterTestCase, self).tearDown()
de... | [
"pyformance.meters.Meter"
] | [((191, 241), 'pyformance.meters.Meter', 'Meter', ([], {'key': '"""test_meter"""', 'clock': 'TimedTestCase.clock'}), "(key='test_meter', clock=TimedTestCase.clock)\n", (196, 241), False, 'from pyformance.meters import Meter\n')] |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2021, <NAME> <@alinabuzachis>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r"""
module: k8s_taint
short_de... | [
"ansible.module_utils._text.to_native",
"copy.deepcopy",
"ansible_collections.kubernetes.core.plugins.module_utils.common.get_api_client",
"ansible_collections.kubernetes.core.plugins.module_utils.common.K8sAnsibleMixin",
"kubernetes.client.api.core_v1_api.CoreV1Api"
] | [((4708, 4736), 'copy.deepcopy', 'copy.deepcopy', (['AUTH_ARG_SPEC'], {}), '(AUTH_ARG_SPEC)\n', (4721, 4736), False, 'import copy\n'), ((5198, 5233), 'ansible_collections.kubernetes.core.plugins.module_utils.common.K8sAnsibleMixin', 'K8sAnsibleMixin', ([], {'module': 'self.module'}), '(module=self.module)\n', (5213, 52... |
import os
from geo.data_dir_config import root
test_submission = root + "submissions/submission_val.csv"
img_list_dir = root + "image_lists/"
train_samples = img_list_dir + "train/samples.npy"
train_samples_species_map = img_list_dir + "train/species_map.py"
test_samples = img_list_dir + "test/samples.npy"
#xgb no... | [
"os.path.exists",
"os.makedirs"
] | [((504, 527), 'os.path.exists', 'os.path.exists', (['xgb_dir'], {}), '(xgb_dir)\n', (518, 527), False, 'import os\n'), ((533, 553), 'os.makedirs', 'os.makedirs', (['xgb_dir'], {}), '(xgb_dir)\n', (544, 553), False, 'import os\n'), ((603, 634), 'os.path.exists', 'os.path.exists', (['submissions_dir'], {}), '(submissions... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-06-19 20:30
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0040_page_draft_title'),
('cms', '0... | [
"django.db.models.ForeignKey"
] | [((488, 721), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'help_text': '"""Choose a page to link to for the Call to Action"""', 'null': '(True)', 'on_delete': 'django.db.models.deletion.SET_NULL', 'related_name': '"""+"""', 'to': '"""wagtailcore.Page"""', 'verbose_name': '"""Hero CTA li... |
# coding: utf-8
"""
CLOUD API
IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and ... | [
"six.iteritems",
"ionoscloud.configuration.Configuration"
] | [((8430, 8463), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (8443, 8463), False, 'import six\n'), ((2090, 2105), 'ionoscloud.configuration.Configuration', 'Configuration', ([], {}), '()\n', (2103, 2105), False, 'from ionoscloud.configuration import Configuration\n')] |
##############################################################################
#
# Copyright (c) 2001 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | [
"zope.container.interfaces.IObjectMovedEvent.providedBy",
"Persistence.PersistentMapping",
"zope.interface.implementer",
"zope.component.getUtility",
"OFS.Cache.getVerifiedManagerIds",
"App.special_dtml.DTMLFile",
"OFS.interfaces.IObjectWillBeMovedEvent.providedBy",
"DateTime.DateTime.DateTime",
"Ac... | [((4039, 4064), 'AccessControl.class_init.InitializeClass', 'InitializeClass', (['CPMCache'], {}), '(CPMCache)\n', (4054, 4064), False, 'from AccessControl.class_init import InitializeClass\n'), ((4068, 4095), 'zope.interface.implementer', 'implementer', (['ICachingPolicy'], {}), '(ICachingPolicy)\n', (4079, 4095), Fal... |
import os
import json
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
# t_stat, p_val = stats.ttest_ind(sample1, sample2, equal_var=False)
test_result_dir = "utils/testresults"
all_results = {}
aggregate_terms = [
"count", "valid", "missing", "distinct", "sum", "mean", "average",
... | [
"numpy.mean"
] | [((3168, 3193), 'numpy.mean', 'np.mean', (['valid_json_array'], {}), '(valid_json_array)\n', (3175, 3193), True, 'import numpy as np\n'), ((3221, 3246), 'numpy.mean', 'np.mean', (['valid_vega_array'], {}), '(valid_vega_array)\n', (3228, 3246), True, 'import numpy as np\n'), ((3284, 3312), 'numpy.mean', 'np.mean', (['ph... |
# file: app.py
import asyncio
import asyncpg
from pgorm.postgresql import PostgreSQL
from myapp.tables import User
async def run():
connection = await asyncpg.connect(
user='reckonsys', password='<PASSWORD>',
database='demo', host='db.reckonsys.com')
pg = PostgreSQL(connection)
# Lets cre... | [
"myapp.tables.User",
"pgorm.postgresql.PostgreSQL",
"asyncpg.connect",
"asyncio.get_event_loop"
] | [((621, 645), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (643, 645), False, 'import asyncio\n'), ((283, 305), 'pgorm.postgresql.PostgreSQL', 'PostgreSQL', (['connection'], {}), '(connection)\n', (293, 305), False, 'from pgorm.postgresql import PostgreSQL\n'), ((158, 260), 'asyncpg.connect', '... |
import os
from pathlib import Path
from appdirs import user_cache_dir
from ._file import make_sure_dir_exist
CUSTOM_CACHE = None
BGEN_READER_CACHE_HOME = Path(
os.environ.get(
"BGEN_READER_CACHE_HOME",
default=Path(user_cache_dir("bgen-reader", "limix")) / "bgen-reader",
)
)
def custom_met... | [
"appdirs.user_cache_dir"
] | [((239, 277), 'appdirs.user_cache_dir', 'user_cache_dir', (['"""bgen-reader"""', '"""limix"""'], {}), "('bgen-reader', 'limix')\n", (253, 277), False, 'from appdirs import user_cache_dir\n')] |
"""`trash` lives on `GitHub <http://github.com/halst/trash/>`_."""
from distutils.core import setup
setup(name='trash',
version='0.1.0',
description='Safe `rm` substitute for OS X',
long_description=__doc__,
license='MIT',
author='<NAME>',
author_email='<EMAIL>',
url='https:/... | [
"distutils.core.setup"
] | [((102, 594), 'distutils.core.setup', 'setup', ([], {'name': '"""trash"""', 'version': '"""0.1.0"""', 'description': '"""Safe `rm` substitute for OS X"""', 'long_description': '__doc__', 'license': '"""MIT"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/halst/trash/"""', 'c... |
# -*- coding:utf-8 -*-
from copy import deepcopy
from itertools import combinations_with_replacement
import pytest
from anywhere import testsets
@pytest.mark.parametrize(
'where_obj,string',
zip(
testsets.WHERES,
testsets.STRINGS,
),
ids=[str(i) for i in range(1, len(testsets.WHERES)... | [
"itertools.combinations_with_replacement",
"copy.deepcopy"
] | [((746, 795), 'itertools.combinations_with_replacement', 'combinations_with_replacement', (['testsets.WHERES', '(2)'], {}), '(testsets.WHERES, 2)\n', (775, 795), False, 'from itertools import combinations_with_replacement\n'), ((1247, 1266), 'copy.deepcopy', 'deepcopy', (['where_obj'], {}), '(where_obj)\n', (1255, 1266... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | [
"fnmatch.filter",
"subprocess.Popen",
"os.path.join",
"kudu.schema_builder",
"os.path.exists",
"time.sleep",
"kudu.connect",
"shutil.rmtree",
"kudu.client.Partitioning",
"os.getenv"
] | [((1291, 1314), 'os.getenv', 'os.getenv', (['"""KUDU_BUILD"""'], {}), "('KUDU_BUILD')\n", (1300, 1314), False, 'import os\n'), ((2310, 2345), 'subprocess.Popen', 'subprocess.Popen', (['path'], {'shell': '(False)'}), '(path, shell=False)\n', (2326, 2345), False, 'import subprocess\n'), ((4614, 4639), 'shutil.rmtree', 's... |
# -*- coding: utf-8 -*-
# system('python tickets.py "Sergio" "Fernandez" "<EMAIL>" "950001" "968868968"')
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoS... | [
"selenium.webdriver.PhantomJS",
"selenium.webdriver.common.action_chains.ActionChains",
"sys.argv.pop",
"time.sleep"
] | [((514, 528), 'sys.argv.pop', 'sys.argv.pop', ([], {}), '()\n', (526, 528), False, 'import sys\n'), ((534, 548), 'sys.argv.pop', 'sys.argv.pop', ([], {}), '()\n', (546, 548), False, 'import sys\n'), ((557, 571), 'sys.argv.pop', 'sys.argv.pop', ([], {}), '()\n', (569, 571), False, 'import sys\n'), ((579, 593), 'sys.argv... |
import numpy as np
import torch
from PIL import Image
import torchvision.transforms as T
from infer import Inference
from utils.nms import nms
torch.set_grad_enabled(False)
def class_agnostic_nms(boxes, scores, iou=0.5):
if len(boxes) > 1:
boxes, scores = nms(np.array(boxes), np.array(scores), iou)
... | [
"torch.stack",
"torchvision.transforms.Normalize",
"torch.cat",
"PIL.Image.open",
"torchvision.transforms.ToTensor",
"numpy.array",
"numpy.linspace",
"torch.set_grad_enabled",
"torch.tensor",
"infer.Inference.__init__",
"torchvision.transforms.Resize"
] | [((144, 173), 'torch.set_grad_enabled', 'torch.set_grad_enabled', (['(False)'], {}), '(False)\n', (166, 173), False, 'import torch\n'), ((926, 970), 'numpy.linspace', 'np.linspace', (['(0)', '(img_w - x_inc)', 'crop_chunks_y'], {}), '(0, img_w - x_inc, crop_chunks_y)\n', (937, 970), True, 'import numpy as np\n'), ((194... |
from pytube import YouTube
import re
import os
#Action
class AuxFunctions():
def get_resolutions(self, url):
res_exist = {'144p': False, '240p': False, '360p': False, '480p': False, '720p': False, '1080p': False, '1440p': False, '2160p': False, '4320p': False}
resolutions_list = list()
func... | [
"os.remove",
"pytube.YouTube",
"os.path.exists",
"re.sub",
"re.compile"
] | [((396, 408), 'pytube.YouTube', 'YouTube', (['url'], {}), '(url)\n', (403, 408), False, 'from pytube import YouTube\n'), ((1099, 1164), 're.compile', 're.compile', (['"""[😀-🙏🌀-🗿🚀-\U0001f6ff\U0001f1e0-🇿]+"""'], {'flags': 're.UNICODE'}), "('[😀-🙏🌀-🗿🚀-\\U0001f6ff\\U0001f1e0-🇿]+', flags=re.UNICODE)\n", (1109, 11... |
# -*- coding: utf-8 -*-
import hashlib
import logging
import os
import tempfile
import time
import cv2
import numpy as np
WIDTH_HEIGHT_LIMIT = 1600 # in pixel
def resize_large_image(image_data):
img_array = np.fromstring(image_data, dtype=np.uint8)
image = cv2.imdecode(img_array, 1)
height, width = ima... | [
"tempfile.NamedTemporaryFile",
"os.remove",
"os.stat",
"cv2.imwrite",
"cv2.imdecode",
"time.time",
"hashlib.sha256",
"cv2.imread",
"numpy.fromstring",
"os.path.isfile",
"os.path.join",
"os.listdir",
"cv2.resize"
] | [((216, 257), 'numpy.fromstring', 'np.fromstring', (['image_data'], {'dtype': 'np.uint8'}), '(image_data, dtype=np.uint8)\n', (229, 257), True, 'import numpy as np\n'), ((270, 296), 'cv2.imdecode', 'cv2.imdecode', (['img_array', '(1)'], {}), '(img_array, 1)\n', (282, 296), False, 'import cv2\n'), ((1407, 1418), 'time.t... |
import json
def load_json(file_name):
with open(file_name) as json_data:
return json.load(json_data) | [
"json.load"
] | [((92, 112), 'json.load', 'json.load', (['json_data'], {}), '(json_data)\n', (101, 112), False, 'import json\n')] |
import importlib
from hydroDL.master import basins
from hydroDL.app import waterQuality, wqLinear
from hydroDL import kPath
from hydroDL.model import trainTS
from hydroDL.data import gageII, usgs
from hydroDL.post import axplot, figplot
import torch
import os
import json
import numpy as np
import pandas as pd
import m... | [
"hydroDL.post.axplot.plotTS",
"hydroDL.app.waterQuality.calErrSeq",
"hydroDL.post.figplot.clickMap",
"numpy.datetime64",
"matplotlib.pyplot.subplots",
"hydroDL.app.waterQuality.DataModelWQ",
"hydroDL.master.basins.loadSeq",
"importlib.reload",
"hydroDL.master.basins.loadMaster",
"hydroDL.post.axpl... | [((400, 436), 'hydroDL.app.waterQuality.DataModelWQ', 'waterQuality.DataModelWQ', (['"""Silica64"""'], {}), "('Silica64')\n", (424, 436), False, 'from hydroDL.app import waterQuality, wqLinear\n'), ((555, 581), 'hydroDL.master.basins.loadMaster', 'basins.loadMaster', (['outName'], {}), '(outName)\n', (572, 581), False,... |
#!/bin/python3
import sys
import os
import Markov
if __name__ == "__main__":
if (len(sys.argv) < 2 or len(sys.argv) > 3):
print("usage: {} sourcefile.txt [existingbrain.json]".format(
sys.argv[0]))
sys.exit(-1)
if (not os.path.exists(sys.argv[1])):
print("Can't find sourc... | [
"Markov.Brain",
"os.path.exists",
"sys.exit"
] | [((388, 402), 'Markov.Brain', 'Markov.Brain', ([], {}), '()\n', (400, 402), False, 'import Markov\n'), ((233, 245), 'sys.exit', 'sys.exit', (['(-1)'], {}), '(-1)\n', (241, 245), False, 'import sys\n'), ((259, 286), 'os.path.exists', 'os.path.exists', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (273, 286), False, 'import ... |
import vne
from vne.constants import nfeat, nsensors
from vne.model import simpleModel, init_weights_simple
from vne.persist import save_model, load_model
import numpy as np
import torch
import os
def encode_save(sig=np.random.random([1, nfeat, nsensors]), name='simpleModel_ini', dir_path="../src/vne/models"):
""... | [
"vne.persist.save_model",
"torch.onnx.export",
"vne.model.simpleModel",
"torch.randn",
"vne.persist.load_model",
"numpy.random.random",
"os.path.join"
] | [((219, 257), 'numpy.random.random', 'np.random.random', (['[1, nfeat, nsensors]'], {}), '([1, nfeat, nsensors])\n', (235, 257), True, 'import numpy as np\n'), ((1351, 1406), 'vne.persist.save_model', 'save_model', ([], {'encoder': 'model', 'name': 'name', 'dir_path': 'dir_path'}), '(encoder=model, name=name, dir_path=... |
import os
import argparse
import configargparse
import time
import glob
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision.transforms import functional as VF
from torch.nn import functional as F
import cv2
import model
import data
from eval.kitti_depth_eval_utils import ... | [
"torchvision.transforms.functional.normalize",
"model.to",
"os.makedirs",
"torch.utils.data.DataLoader",
"torchvision.transforms.functional.to_tensor",
"os.path.join",
"torch.load",
"cv2.imwrite",
"numpy.savez",
"numpy.percentile",
"numpy.min",
"model.eval",
"numpy.squeeze",
"model.depth_n... | [((1346, 1363), 'opts.parse_args', 'opts.parse_args', ([], {}), '()\n', (1361, 1363), False, 'import opts\n'), ((1425, 1452), 'torch.load', 'torch.load', (['args.checkpoint'], {}), '(args.checkpoint)\n', (1435, 1452), False, 'import torch\n'), ((1458, 1501), 'os.makedirs', 'os.makedirs', (['args.output_dir'], {'exist_o... |
import filecmp
import glob
import os
import platform
import re
import shutil
import unittest
import zipfile
import update_searchable_options
class SearchableOptionTests(unittest.TestCase):
"""Tests searchable options to be up-to-date.
This test purpose is to generate these files, so whenever a
configurable or ... | [
"unittest.main",
"os.listdir",
"re.match",
"platform.system",
"update_searchable_options.generate_searchable_options",
"os.path.join",
"os.getenv",
"filecmp.dircmp"
] | [((2802, 2817), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2815, 2817), False, 'import unittest\n'), ((463, 487), 'os.getenv', 'os.getenv', (['"""TEST_TMPDIR"""'], {}), "('TEST_TMPDIR')\n", (472, 487), False, 'import os\n'), ((507, 541), 'os.path.join', 'os.path.join', (['work_dir', '"""expected"""'], {}), "(... |
"""Armijo rule."""
import numpy as np
from optimus.types import LRMethod, Function
class Armijo(LRMethod):
"""Armijo method for finding Learning Rate.
This method successively reduces the learning rate until it finds the
resulting change to be as good as a linear approximation of the function.
"""
... | [
"numpy.dot"
] | [((1071, 1098), 'numpy.dot', 'np.dot', (['gradient', 'direction'], {}), '(gradient, direction)\n', (1077, 1098), True, 'import numpy as np\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... | [
"json.loads",
"logging.getLogger"
] | [((678, 705), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (695, 705), False, 'import logging\n'), ((3666, 3687), 'json.loads', 'json.loads', (['resp.text'], {}), '(resp.text)\n', (3676, 3687), False, 'import json\n')] |
#!/usr/bin/python3
from pygame import mixer
import re, os, signal
import paho.mqtt.client as mqtt
import config
class Player():
def __init__(self, path=""):
self.__path = path
self.__mixer = mixer
self.__mixer.init()
self.__vlc_pid = None
self.__vlc_url = None
def se... | [
"os.system",
"re.match",
"os._exit",
"os.fork",
"paho.mqtt.client.Client"
] | [((1113, 1141), 'paho.mqtt.client.Client', 'mqtt.Client', (['config.HOSTNAME'], {}), '(config.HOSTNAME)\n', (1124, 1141), True, 'import paho.mqtt.client as mqtt\n'), ((1597, 1637), 're.match', 're.match', (['"""play web (.*)"""', 'request', 're.I'], {}), "('play web (.*)', request, re.I)\n", (1605, 1637), False, 'impor... |
import unittest
import binary_search
class test_binary_search(unittest.TestCase):
def test_binary_search_returns_true_when_search_key_found(self):
self.assertTrue(binary_search.binary_search([3, 1, 2], 2))
def test_binary_search_returns_false_when_search_key_not_found(self):
self.assertFalse(... | [
"binary_search.binary_search"
] | [((177, 218), 'binary_search.binary_search', 'binary_search.binary_search', (['[3, 1, 2]', '(2)'], {}), '([3, 1, 2], 2)\n', (204, 218), False, 'import binary_search\n'), ((320, 361), 'binary_search.binary_search', 'binary_search.binary_search', (['[3, 1, 2]', '(0)'], {}), '([3, 1, 2], 0)\n', (347, 361), False, 'import ... |
from astropy.cosmology.funcs import z_at_value
import numpy as np
from pyHalo.single_realization import SingleHalo
import numpy.testing as npt
import numpy as np
from pyHalo.Halos.HaloModels.ULDM import ULDMFieldHalo, ULDMSubhalo
from pyHalo.Halos.lens_cosmo import LensCosmo
from pyHalo.Cosmology.cosmology import Cosmo... | [
"pyHalo.Cosmology.cosmology.Cosmology",
"lenstronomy.LensModel.Profiles.uldm.Uldm",
"lenstronomy.LensModel.Profiles.cnfw.CNFW",
"numpy.testing.assert_almost_equal",
"pyHalo.single_realization.SingleHalo",
"pytest.main",
"numpy.testing.assert_string_equal",
"numpy.array",
"numpy.testing.assert_equal"... | [((5016, 5029), 'pytest.main', 'pytest.main', ([], {}), '()\n', (5027, 5029), False, 'import pytest\n'), ((613, 644), 'numpy.sqrt', 'np.sqrt', (['(1 + 0.5 ** 2 + 70 ** 2)'], {}), '(1 + 0.5 ** 2 + 70 ** 2)\n', (620, 644), True, 'import numpy as np\n'), ((1168, 1204), 'pyHalo.Cosmology.cosmology.Cosmology', 'Cosmology', ... |
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import get_user_model
class UserForm(UserCreationForm):
class Meta:
model = get_user_model()
fields = ('username', '<PASSWORD>', '<PASSWORD>', )
| [
"django.contrib.auth.get_user_model"
] | [((169, 185), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (183, 185), False, 'from django.contrib.auth import get_user_model\n')] |
from generator import Generator
import numpy as np, random
np.set_printoptions(precision=4, suppress=True, linewidth=132)
from tensorflow import keras
from tensorflow.keras.layers import LSTM, Dense, Input
from tensorflow.keras import Model
from tensorflow.keras.optimizers import Adagrad
def create_net(nwords, batch... | [
"numpy.set_printoptions",
"numpy.sum",
"random.randint",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Model",
"numpy.array",
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.LSTM",
"numpy.random.choice",
"generator.Generator",
"tensorflow.keras.optimizers.Adagrad"
] | [((60, 122), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(4)', 'suppress': '(True)', 'linewidth': '(132)'}), '(precision=4, suppress=True, linewidth=132)\n', (79, 122), True, 'import numpy as np, random\n'), ((350, 394), 'tensorflow.keras.layers.Input', 'Input', (['(None, nwords)'], {'batch_siz... |
import json
import re
import matplotlib.pyplot as plt
import pandas as pd
import scipy.stats
import eternal.card
import eternal.ewc
import eternal.plot
CARDS_DATA = eternal.card.ALL.data
def imode(src):
"""Return a copy of a series where all case-insensitive versions have been replaced with the most common cas... | [
"matplotlib.pyplot.title",
"pandas.read_csv",
"matplotlib.pyplot.figure",
"pandas.DataFrame",
"pandas.merge",
"pandas.concat",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"pandas.Series",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.grid",
"matplotlib.py... | [((4916, 4967), 'pandas.Series', 'pd.Series', ([], {'index': 'card_counts.index', 'dtype': '"""float64"""'}), "(index=card_counts.index, dtype='float64')\n", (4925, 4967), True, 'import pandas as pd\n'), ((12576, 12696), 'pandas.merge', 'pd.merge', (['power_by_player', 'powercount_by_player'], {'left_index': '(True)', ... |
# Generated by Django 2.2.2 on 2019-06-20 11:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('part', '0010_auto_20190620_2135'),
]
operations = [
migrations.AddField(
model_name='part',
name='revision',
... | [
"django.db.models.CharField"
] | [((331, 424), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'help_text': '"""Part revision or version number"""', 'max_length': '(100)'}), "(blank=True, help_text='Part revision or version number',\n max_length=100)\n", (347, 424), False, 'from django.db import migrations, models\n')] |
#!/usr/bin/env python3
import argparse
class Rectangle:
def __init__(self, x, y, w, h):
self.x = x
self.y = y
self.w = w
self.h = h
def __repr__(self):
return f'DRAW_RECTANGLE {self.x},{self.y},{self.w},{self.h}'
@staticmethod
def spawn(start, delta_x, delta_y... | [
"argparse.ArgumentParser"
] | [((976, 1001), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (999, 1001), False, 'import argparse\n')] |
import json
from emotion import ProcessEmotions
f = open("reddit.json",encoding = 'utf-8')
loaded = json.load(f)
data = loaded["data"]["children"]
text = map(lambda x: x["data"]["title"], data)
res = map(ProcessEmotions, text)
for item in res:
if item:
for i in item:
if i["valid"]:
... | [
"json.load"
] | [((101, 113), 'json.load', 'json.load', (['f'], {}), '(f)\n', (110, 113), False, 'import json\n')] |
"""Sensor from an SQL Query."""
from __future__ import annotations
from datetime import date
import decimal
import logging
import sqlalchemy
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.orm import scoped_session, sessionmaker
import voluptuous as vol
from homeassistant.components.recorder import CONF_D... | [
"voluptuous.Optional",
"homeassistant.helpers.entity.DeviceInfo",
"voluptuous.Required",
"sqlalchemy.create_engine",
"sqlalchemy.orm.sessionmaker",
"logging.getLogger",
"homeassistant.helpers.template.Template"
] | [((1179, 1206), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1196, 1206), False, 'import logging\n'), ((1389, 1419), 'voluptuous.Required', 'vol.Required', (['CONF_COLUMN_NAME'], {}), '(CONF_COLUMN_NAME)\n', (1401, 1419), True, 'import voluptuous as vol\n'), ((1440, 1463), 'voluptuous.... |
import numpy as np
import matplotlib.pyplot as plt
import os
import cv2
from scipy.ndimage import gaussian_filter, median_filter
from matplotlib.animation import FuncAnimation
from perlin_noise import PerlinNoise
##########################################################################################
# FUNCTIONS FOR... | [
"perlin_noise.PerlinNoise",
"numpy.sum",
"matplotlib.pyplot.figure",
"numpy.linalg.norm",
"numpy.random.normal",
"matplotlib.pyplot.gca",
"cv2.VideoWriter",
"scipy.ndimage.median_filter",
"os.path.join",
"scipy.ndimage.gaussian_filter",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.close",
... | [((2777, 2799), 'numpy.zeros', 'np.zeros', (['matrix.shape'], {}), '(matrix.shape)\n', (2785, 2799), True, 'import numpy as np\n'), ((2812, 2834), 'numpy.zeros', 'np.zeros', (['matrix.shape'], {}), '(matrix.shape)\n', (2820, 2834), True, 'import numpy as np\n'), ((2847, 2869), 'numpy.zeros', 'np.zeros', (['matrix.shape... |
import random
a1 = input('Primeiro aluno: ')
a2 = input('Segundo aluno: ')
a3 = input('Terceiro aluno: ')
a4 = input('Quarto aluno: ')
sorteio = [a1,a2,a3,a4]
random.shuffle(sorteio)
#Shuffle (embaralha lista)
#Choice (Escolhe 1 da lista)
print(f'Ordem de apresentação: {sorteio}')
| [
"random.shuffle"
] | [((165, 188), 'random.shuffle', 'random.shuffle', (['sorteio'], {}), '(sorteio)\n', (179, 188), False, 'import random\n')] |
"""This module provides the necessary cryptographic primitives for the system.
It is based on the `cryptography <https://cryptography.io/en/latest/>`_
package."""
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitive... | [
"cryptography.hazmat.primitives.hashes.SHA256",
"cryptography.hazmat.primitives.ciphers.algorithms.AES",
"cryptography.hazmat.primitives.ciphers.modes.GCM",
"cryptography.hazmat.backends.default_backend",
"cryptography.hazmat.primitives.asymmetric.padding.PKCS1v15"
] | [((2796, 2814), 'cryptography.hazmat.primitives.asymmetric.padding.PKCS1v15', 'padding.PKCS1v15', ([], {}), '()\n', (2812, 2814), False, 'from cryptography.hazmat.primitives.asymmetric import padding\n'), ((2824, 2839), 'cryptography.hazmat.primitives.hashes.SHA256', 'hashes.SHA256', ([], {}), '()\n', (2837, 2839), Fal... |
#!/usr/bin/env python3
# Test Interactive
import datetime
from core import config,raiDB,SMSInteractive
input = True
doorType = 'glass'
print(datetime.datetime.now())
databaseInteractive.interactive(input,doorType)
#SMSInteractive.interactive(input)
| [
"datetime.datetime.now"
] | [((144, 167), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (165, 167), False, 'import datetime\n')] |
_url = 'https://raw.githubusercontent.com/mikkokotila/version-controlled-data/master/data/polymod_social_contact_data.csv'
class Polymod:
def __init__(self, data=None):
import pandas as _pd
self.data = _pd.read_csv(_url)
def country_data(self, country_code='fi'):
... | [
"pandas.read_csv",
"numpy.array"
] | [((246, 264), 'pandas.read_csv', '_pd.read_csv', (['_url'], {}), '(_url)\n', (258, 264), True, 'import pandas as _pd\n'), ((3351, 3373), 'numpy.array', 'np.array', (['restrictions'], {}), '(restrictions)\n', (3359, 3373), True, 'import numpy as np\n'), ((953, 979), 'numpy.array', 'np.array', (['age_distribution'], {}),... |
"""
Copyright: Wenyi Tang 2017-2019
Author: <NAME>
Email: <EMAIL>
Created Date: Jan 7th, 2019
Misc utility tools
- make TFRecords files
"""
# Copyright (c): <NAME> 2017-2019.
# Author: <NAME>
# Email: <EMAIL>
# Update Date: 2019/4/3 下午5:03
import tensorflow as tf
def make_tensor_label_records(tensors, labels, ... | [
"tensorflow.train.BytesList",
"tensorflow.train.Features",
"tensorflow.train.Feature"
] | [((625, 655), 'tensorflow.train.BytesList', 'tf.train.BytesList', ([], {'value': '[_t]'}), '(value=[_t])\n', (643, 655), True, 'import tensorflow as tf\n'), ((492, 511), 'tensorflow.train.Features', 'tf.train.Features', ([], {}), '()\n', (509, 511), True, 'import tensorflow as tf\n'), ((725, 756), 'tensorflow.train.Fea... |
import pytest
from sitri.contrib.system import SystemConfigProvider, SystemCredentialProvider
@pytest.fixture(scope="module")
def system_config() -> SystemConfigProvider:
return SystemConfigProvider(prefix="test")
@pytest.fixture(scope="module")
def system_credential() -> SystemCredentialProvider:
return S... | [
"sitri.contrib.system.SystemCredentialProvider",
"pytest.fixture",
"sitri.contrib.system.SystemConfigProvider"
] | [((98, 128), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (112, 128), False, 'import pytest\n'), ((224, 254), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (238, 254), False, 'import pytest\n'), ((185, 220), 'sitri.contrib.system... |
"""Main module."""
import whisk
from whisk.cli.log_tree import PARENT_TREE_NODE_PREFIX, CHILD_TREE_NODE_PREFIX
from cookiecutter.main import cookiecutter
from os.path import realpath
# https://docs.python.org/3/library/pathlib.html
# Object-oriented filesystem paths
from pathlib import Path
import logging
logger = log... | [
"os.path.realpath",
"logging.getLogger",
"pathlib.Path"
] | [((317, 344), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (334, 344), False, 'import logging\n'), ((465, 483), 'os.path.realpath', 'realpath', (['__file__'], {}), '(__file__)\n', (473, 483), False, 'from os.path import realpath\n'), ((495, 509), 'pathlib.Path', 'Path', (['filepath'], {... |
# -*- coding: utf-8 -*-
# @Time : 2019/1/8 下午8:20
# @Author : yidxue
from __future__ import division
import numpy
import datetime
import pandas as pd
def get_all_file_path(path):
"""
循环遍历,得到一个文件夹第一层下的文件路径
"""
import os
file_name_list = os.listdir(path)
return [path + os.sep + file_name for... | [
"pandas.Series",
"datetime.datetime.strptime",
"os.listdir",
"numpy.sqrt"
] | [((262, 278), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (272, 278), False, 'import os\n'), ((1673, 1693), 'numpy.sqrt', 'numpy.sqrt', (['variance'], {}), '(variance)\n', (1683, 1693), False, 'import numpy\n'), ((2234, 2290), 'pandas.Series', 'pd.Series', (['{item[0]: item[1] for item in data_sort[key]}'],... |
# -*- coding: utf-8 -*-
u"""Implements a state machine for the parsing process.
"""
# TODO: translation API
from __future__ import absolute_import
from httoop.exceptions import Invalid, InvalidBody, InvalidHeader, InvalidLine, InvalidURI
from httoop.header import Headers
from httoop.messages import Message
from httoo... | [
"httoop.header.Headers",
"httoop.status.BAD_REQUEST",
"httoop.status.NOT_IMPLEMENTED",
"httoop.util._",
"httoop.util.Unicode"
] | [((7145, 7154), 'httoop.header.Headers', 'Headers', ([], {}), '()\n', (7152, 7154), False, 'from httoop.header import Headers\n'), ((7685, 7737), 'httoop.status.BAD_REQUEST', 'BAD_REQUEST', (['(u\'untold trailers: "%s"\' % msg_trailers)'], {}), '(u\'untold trailers: "%s"\' % msg_trailers)\n', (7696, 7737), False, 'from... |
"""
Tests for preferences route
"""
import json
from fastapi.testclient import TestClient
from config.settings import settings
jwt_test = settings.test_jwt
header = {"Authorization": f"Bearer {jwt_test}"}
ROUTE = "/preferences/"
body = json.dumps(
{
"email": "string",
"preferences": ["EVENTS", "... | [
"json.dumps"
] | [((240, 327), 'json.dumps', 'json.dumps', (["{'email': 'string', 'preferences': ['EVENTS', 'AMBIENCE', 'MARKETING']}"], {}), "({'email': 'string', 'preferences': ['EVENTS', 'AMBIENCE',\n 'MARKETING']})\n", (250, 327), False, 'import json\n')] |
#-*- coding: utf-8 -*-
# vim: set fileencoding=utf-8
"""
settings.py
Configuration for Flask app
Important: Place your keys in the secret_keys.py module,
which should be kept out of version control.
"""
import logging
import os
import urllib
from secret_keys import CSRF_SECRET_KEY, SESSION_KEY
class C... | [
"os.environ.get",
"google.appengine.api.app_identity.get_application_id"
] | [((4038, 4072), 'os.environ.get', 'os.environ.get', (['"""QUERY_STRING"""', '""""""'], {}), "('QUERY_STRING', '')\n", (4052, 4072), False, 'import os\n'), ((3932, 3965), 'os.environ.get', 'os.environ.get', (['"""SCRIPT_NAME"""', '""""""'], {}), "('SCRIPT_NAME', '')\n", (3946, 3965), False, 'import os\n'), ((3996, 4027)... |
# coding: utf-8
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------... | [
"unittest.main",
"devtools_testutils.ResourceGroupPreparer"
] | [((756, 779), 'devtools_testutils.ResourceGroupPreparer', 'ResourceGroupPreparer', ([], {}), '()\n', (777, 779), False, 'from devtools_testutils import AzureMgmtTestCase, ResourceGroupPreparer\n'), ((1700, 1715), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1713, 1715), False, 'import unittest\n')] |
import argparse
from chess_player.ChessGame import ChessGame
from chess_player.Player import SearchPlayer, RandomPlayer
from chess_player.Scorer import SimplifiedEvaluationFunction
from random import randint
from time import perf_counter
class Program:
@staticmethod
def main():
program = Program()
... | [
"random.randint",
"argparse.ArgumentParser",
"chess_player.Player.RandomPlayer",
"chess_player.Scorer.SimplifiedEvaluationFunction",
"time.perf_counter",
"chess_player.Player.SearchPlayer",
"chess_player.ChessGame.ChessGame"
] | [((413, 467), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Play some chess"""'}), "(description='Play some chess')\n", (436, 467), False, 'import argparse\n'), ((491, 521), 'chess_player.Scorer.SimplifiedEvaluationFunction', 'SimplifiedEvaluationFunction', ([], {}), '()\n', (519, 521),... |
# -*- coding: utf-8 -*-
from bouser.utils import as_json
__author__ = 'viruzzz-kun'
class Message(object):
immediate = True # Мгновенное сообщение: будет ставиться в очередь, не пишется в лог
secondary = False # Вторичное сообщение: не пишется в лог
control = False # Управляющее сообщение: для упра... | [
"os.urandom"
] | [((712, 726), 'os.urandom', 'os.urandom', (['(16)'], {}), '(16)\n', (722, 726), False, 'import os\n')] |
# -*- coding: utf-8 -*-
# Copyright (C) 2019 by <NAME>
#
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby
# granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIE... | [
"pycflare.CloudFlare",
"werkzeug.local.LocalProxy"
] | [((810, 867), 'werkzeug.local.LocalProxy', 'LocalProxy', (["(lambda : current_app.extensions['cloudflare'])"], {}), "(lambda : current_app.extensions['cloudflare'])\n", (820, 867), False, 'from werkzeug.local import LocalProxy\n'), ((1531, 1630), 'pycflare.CloudFlare', 'PyCloudFlare', ([], {'auth_email': 'auth_email', ... |
from collections import OrderedDict
class Sample(object):
''' hold sample data for a variant (e.g. genotype call, allele depths)
'''
# set up a class variable that will be shared by all Sample instances, ie,
# all individuals for a given variant. That way they have a common set of
# keys for the v... | [
"collections.OrderedDict"
] | [((341, 354), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (352, 354), False, 'from collections import OrderedDict\n'), ((434, 447), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (445, 447), False, 'from collections import OrderedDict\n')] |
from flask import url_for
from tests import FrontendWithAdminTestBase
from tests.factories import RoomFactory, SubnetFactory, PatchPortFactory
class UserLogTestBase(FrontendWithAdminTestBase):
def get_logs(self, user_id=None, **kw):
"""Request the logs, assert validity, and return the response.
... | [
"tests.factories.RoomFactory",
"flask.url_for",
"tests.factories.SubnetFactory",
"tests.factories.PatchPortFactory"
] | [((721, 779), 'flask.url_for', 'url_for', (['"""user.user_show_logs_json"""'], {'user_id': 'user_id'}), "('user.user_show_logs_json', user_id=user_id, **kw)\n", (728, 779), False, 'from flask import url_for\n'), ((1213, 1226), 'tests.factories.RoomFactory', 'RoomFactory', ([], {}), '()\n', (1224, 1226), False, 'from te... |
"""
Set of unit test for SourceBase class
"""
import pytest
from mycroft_holmes.errors import MycroftSourceError
from mycroft_holmes.sources.base import SourceBase
from mycroft_holmes.sources import ConstSource
def test_get_sources_names():
sources = SourceBase.get_sources_names()
print(sources)
assert ... | [
"pytest.raises",
"mycroft_holmes.sources.ConstSource",
"mycroft_holmes.sources.base.SourceBase.get_sources_names",
"mycroft_holmes.sources.base.SourceBase.new_from_name"
] | [((258, 288), 'mycroft_holmes.sources.base.SourceBase.get_sources_names', 'SourceBase.get_sources_names', ([], {}), '()\n', (286, 288), False, 'from mycroft_holmes.sources.base import SourceBase\n'), ((387, 427), 'mycroft_holmes.sources.base.SourceBase.new_from_name', 'SourceBase.new_from_name', (['"""common/const"""']... |
import tkinter
from .customtkinter_frame import CTkFrame
from .appearance_mode_tracker import AppearanceModeTracker
from .customtkinter_color_manager import CTkColorManager
class CTkProgressBar(tkinter.Frame):
def __init__(self,
bg_color=None,
border_color=CTkColorManager.PROGRE... | [
"tkinter.Canvas"
] | [((1339, 1430), 'tkinter.Canvas', 'tkinter.Canvas', ([], {'master': 'self', 'highlightthicknes': '(0)', 'width': 'self.width', 'height': 'self.height'}), '(master=self, highlightthicknes=0, width=self.width, height=\n self.height)\n', (1353, 1430), False, 'import tkinter\n')] |
"""
This is a sample stub of loadgen with multiple processes support.
Each process sets its affinity by a proc list.
Loadgen is a producer, which calls issue_queries(). issue_queries() gets query
from loadgen and puts query id/sample indices into an input queue.
Each Consumer(process)'s run() reads input queue, calls... | [
"argparse.ArgumentParser",
"multiprocessing.Lock",
"mlperf_loadgen.TestSettings",
"multiprocessing.Value",
"collections.defaultdict",
"numpy.mean",
"multiprocessing.Queue",
"multiprocessing.Process.__init__",
"subprocess.check_call",
"os.path.exists",
"gluonnlp.data.SQuAD",
"mlperf_loadgen.Log... | [((1116, 1155), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (1135, 1155), False, 'import logging\n'), ((1162, 1193), 'logging.getLogger', 'logging.getLogger', (['"""MXNet-BERT"""'], {}), "('MXNet-BERT')\n", (1179, 1193), False, 'import logging\n'), ((1333, 13... |
# Author: <NAME> (<EMAIL>)
# Center for Machine Perception, Czech Technical University in Prague
"""Evaluation script for the BOP Challenge 2019."""
import os
import time
import argparse
import subprocess
import numpy as np
from bop_toolkit_lib import config
from bop_toolkit_lib import inout
from bop_toolkit_lib imp... | [
"argparse.ArgumentParser",
"os.path.basename",
"bop_toolkit_lib.misc.log",
"time.time",
"bop_toolkit_lib.misc.get_score_signature",
"numpy.mean",
"subprocess.call",
"numpy.arange",
"bop_toolkit_lib.inout.load_json",
"os.path.join",
"bop_toolkit_lib.misc.get_error_signature"
] | [((2255, 2280), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2278, 2280), False, 'import argparse\n'), ((7234, 7251), 'bop_toolkit_lib.misc.log', 'misc.log', (['"""Done."""'], {}), "('Done.')\n", (7242, 7251), False, 'from bop_toolkit_lib import misc\n'), ((3163, 3186), 'bop_toolkit_lib.misc... |
# ---
# jupyter:
# kernelspec:
# display_name: Python 3
# name: python3
# ---
# %% [markdown]
# # The bike rides dataset
#
# In this notebook, we will present the "Bike Ride" dataset. This dataset is
# located in the directory `datasets` in a comma separated values (CSV) format.
#
# We open this dataset usin... | [
"matplotlib.pyplot.title",
"pandas.read_csv",
"matplotlib.pyplot.legend",
"numpy.random.RandomState",
"numpy.arange",
"seaborn.pairplot",
"matplotlib.pyplot.subplots_adjust",
"pandas.qcut",
"matplotlib.pyplot.xlabel"
] | [((367, 408), 'pandas.read_csv', 'pd.read_csv', (['"""../datasets/bike_rides.csv"""'], {}), "('../datasets/bike_rides.csv')\n", (378, 408), True, 'import pandas as pd\n'), ((1387, 1459), 'pandas.read_csv', 'pd.read_csv', (['"""../datasets/bike_rides.csv"""'], {'index_col': '(0)', 'parse_dates': '(True)'}), "('../datase... |
import logging
import random
import numpy as np
# imports for deformed slice
from skimage.draw import line
from scipy.ndimage.measurements import label
from scipy.ndimage.interpolation import map_coordinates
from scipy.ndimage.morphology import binary_dilation
from gunpowder.batch_request import BatchRequest
from gun... | [
"numpy.zeros_like",
"gunpowder.batch_request.BatchRequest",
"scipy.ndimage.morphology.binary_dilation",
"numpy.logical_not",
"numpy.zeros",
"skimage.draw.line",
"numpy.clip",
"scipy.ndimage.interpolation.map_coordinates",
"random.random",
"gunpowder.coordinate.Coordinate",
"numpy.random.randint"... | [((404, 431), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (421, 431), False, 'import logging\n'), ((3550, 3582), 'random.seed', 'random.seed', (['request.random_seed'], {}), '(request.random_seed)\n', (3561, 3582), False, 'import random\n'), ((3598, 3612), 'gunpowder.batch_request.Batc... |
# -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import HttpResponse
from django.shortcuts import render
from django.apps import apps
from municipios.forms import FormMunicipio
def base_url_js(request):
return HttpResponse(u"var __municipios_bas... | [
"django.apps.apps.get_model",
"django.core.urlresolvers.reverse",
"django.db.models.Q",
"django.shortcuts.render",
"municipios.forms.FormMunicipio"
] | [((447, 485), 'django.apps.apps.get_model', 'apps.get_model', (['app_label', 'object_name'], {}), '(app_label, object_name)\n', (461, 485), False, 'from django.apps import apps\n'), ((571, 664), 'django.shortcuts.render', 'render', (['request', '"""municipios/municipios_options.html"""', "{'municipio_list': municipio_l... |
import sys
import subprocess
from setuptools import find_packages, setup
def gdal_warning(msg=None):
raise Exception(f"Unable to determine gdal version using gdal-config: {msg}")
def libgdal_version():
version = None
try:
proc = subprocess.Popen(['gdal-config', '--version'], stdout=subprocess.PI... | [
"subprocess.Popen",
"setuptools.find_packages"
] | [((253, 323), 'subprocess.Popen', 'subprocess.Popen', (["['gdal-config', '--version']"], {'stdout': 'subprocess.PIPE'}), "(['gdal-config', '--version'], stdout=subprocess.PIPE)\n", (269, 323), False, 'import subprocess\n'), ((714, 729), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (727, 729), False, '... |
#wgs report
__author__ = '<NAME>'
#TODO checks for metrics
# write report
# write Ssheet
import csv
import os
import sys
import glob
import datetime
import argparse
import subprocess
from string import Template
parser = argparse.ArgumentParser()
parser.add_argument('-nod', help='Turn off directory c... | [
"os.mkdir",
"argparse.ArgumentParser",
"os.path.isdir",
"csv.DictReader",
"string.Template",
"os.path.isfile",
"glob.glob",
"datetime.datetime.now",
"sys.exit",
"csv.DictWriter"
] | [((240, 265), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (263, 265), False, 'import argparse\n'), ((1971, 2003), 'glob.glob', 'glob.glob', (['"""*.cwl.metrics.*.tsv"""'], {}), "('*.cwl.metrics.*.tsv')\n", (1980, 2003), False, 'import glob\n'), ((2009, 2047), 'sys.exit', 'sys.exit', (['"""cw... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import os
import yaml
from utils.times import run_time
from config.conf import cm
@run_time
def inspect_element():
"""审查所有的元素是否正确"""
for i in os.listdir(cm.ELEMENT_PATH):
_path = os.path.join(cm.ELEMENT_PATH, i)
if os.path.isfile(_path):
... | [
"os.path.isfile",
"os.path.join",
"os.listdir",
"yaml.safe_load"
] | [((198, 225), 'os.listdir', 'os.listdir', (['cm.ELEMENT_PATH'], {}), '(cm.ELEMENT_PATH)\n', (208, 225), False, 'import os\n'), ((243, 275), 'os.path.join', 'os.path.join', (['cm.ELEMENT_PATH', 'i'], {}), '(cm.ELEMENT_PATH, i)\n', (255, 275), False, 'import os\n'), ((287, 308), 'os.path.isfile', 'os.path.isfile', (['_pa... |
import numpy as np
import scipy.ndimage as ndimage
import matplotlib.pyplot as plt
from skimage import data, color, img_as_float
from tkinter import *
from PIL import Image
from graph_cut import GraphCut
from graph_cut_gui import GraphCutGui
class GraphCutController:
def __init__(self):
self.__init_view... | [
"numpy.empty",
"numpy.floor",
"numpy.histogramdd",
"numpy.shape",
"numpy.linalg.norm",
"PIL.Image.blend",
"numpy.copy",
"scipy.ndimage.gaussian_filter",
"matplotlib.pyplot.imshow",
"numpy.logical_not",
"numpy.reshape",
"numpy.bool",
"numpy.size",
"matplotlib.pyplot.show",
"numpy.asarray"... | [((425, 448), 'graph_cut_gui.GraphCutGui', 'GraphCutGui', (['self', 'root'], {}), '(self, root)\n', (436, 448), False, 'from graph_cut_gui import GraphCutGui\n'), ((1178, 1246), 'numpy.histogramdd', 'np.histogramdd', (['data', 'hist_res'], {'range': '[(0, 255), (0, 255), (0, 255)]'}), '(data, hist_res, range=[(0, 255),... |
# superpixels.py Performs SLIC algorithm #
# Authors: <NAME>, <NAME>, <NAME>, <NAME>``
# import the necessary packages
from skimage.segmentation import slic
from skimage.segmentation import mark_boundaries
from skimage.util import img_as_float
from skimage.util import img_as_ubyte
from skimage import data, io, segment... | [
"numpy.dstack",
"skimage.color.label2rgb",
"skimage.util.img_as_ubyte",
"skimage.future.graph.merge_hierarchical",
"numpy.linalg.norm",
"skimage.future.graph.rag_mean_color",
"skimage.segmentation.slic",
"skimage.util.img_as_float",
"os.listdir",
"skimage.io.imread"
] | [((668, 688), 'numpy.linalg.norm', 'np.linalg.norm', (['diff'], {}), '(diff)\n', (682, 688), True, 'import numpy as np\n'), ((1187, 1208), 'skimage.io.imread', 'io.imread', (['sourcePath'], {}), '(sourcePath)\n', (1196, 1208), False, 'from skimage import data, io, segmentation, color\n'), ((1282, 1329), 'numpy.dstack',... |
# -*- coding: utf-8 -*-
import asyncio
import inspect
import os
import signal as _signal
import sys
import traceback
from asyncio import (
AbstractEventLoop,
StreamReader,
StreamWriter,
)
from asyncio import Queue # noqa: F401
from contextlib import contextmanager
from itertools import count
from unitte... | [
"traceback.format_exception",
"asyncio.get_event_loop",
"asyncio.Event",
"os.environ.items",
"itertools.count",
"unittest.mock.patch",
"inspect.signature",
"asyncio.wait",
"asyncio.Queue",
"asyncio.Future"
] | [((541, 561), 'inspect.signature', 'inspect.signature', (['f'], {}), '(f)\n', (558, 561), False, 'import inspect\n'), ((8543, 8557), 'itertools.count', 'count', ([], {'start': '(1)'}), '(start=1)\n', (8548, 8557), False, 'from itertools import count\n'), ((3396, 3411), 'asyncio.Queue', 'asyncio.Queue', ([], {}), '()\n'... |
"""
Tests - Deuce Client - API - Project
"""
from unittest import TestCase
import deuceclient.api as api
import deuceclient.common.errors as errors
import deuceclient.common.validation as val
from deuceclient.tests import *
class ProjectTest(TestCase):
def setUp(self):
super(ProjectTest, self).setUp()
... | [
"deuceclient.api.Project",
"deuceclient.api.Vault"
] | [((467, 495), 'deuceclient.api.Project', 'api.Project', (['self.project_id'], {}), '(self.project_id)\n', (478, 495), True, 'import deuceclient.api as api\n'), ((1184, 1212), 'deuceclient.api.Project', 'api.Project', (['self.project_id'], {}), '(self.project_id)\n', (1195, 1212), True, 'import deuceclient.api as api\n'... |
"""Implementation of the longest increasing subsequence algorithm."""
import operator
from bisect import bisect_right, bisect_left
from typing import TypeVar, Optional, List, Any, Iterator, Sequence, Callable
T = TypeVar('T')
def longest_increasing_subsequence(seq: Sequence[T], strict=False, key: Callable = None) ->... | [
"typing.TypeVar"
] | [((214, 226), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (221, 226), False, 'from typing import TypeVar, Optional, List, Any, Iterator, Sequence, Callable\n')] |
from cmath import sqrt
from math import hypot
from utils import near_equal
class Vector2D:
def __init__(self, x, y):
self.x = x
self.y = y
def normalized(self):
modulus = sqrt(self.x * self.x + self.y * self.y)
return Vector2D(self.x / modulus, self.y / modulus)
def dot(s... | [
"unittest.main",
"math.hypot",
"cmath.sqrt",
"utils.near_equal"
] | [((2172, 2187), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2185, 2187), False, 'import unittest\n'), ((206, 245), 'cmath.sqrt', 'sqrt', (['(self.x * self.x + self.y * self.y)'], {}), '(self.x * self.x + self.y * self.y)\n', (210, 245), False, 'from cmath import sqrt\n'), ((1326, 1367), 'math.hypot', 'hypot', ... |
#External libs
import boto3
import sys
import json
import os
from botocore.exceptions import ClientError
#Establish our boto resources
client = boto3.client('lambda')
#This is only here for printing pretty colors
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m... | [
"sys.exit",
"boto3.client"
] | [((145, 167), 'boto3.client', 'boto3.client', (['"""lambda"""'], {}), "('lambda')\n", (157, 167), False, 'import boto3\n'), ((1337, 1348), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (1345, 1348), False, 'import sys\n')] |
import os
import glob
from preprocess import clahe_gridsize
import cv2
train_ratio = 0.7
eval_ratio = 0.3
test_ratio = 0.
def get_images(image_dir, preprocess=False, phase='train', healthy_included=True):
if preprocess:
limit = 2
grid_size = 8
if not os.path.exists(os.path.join(image_dir, ... | [
"os.path.exists",
"preprocess.clahe_gridsize",
"cv2.imread",
"os.path.split",
"os.path.join"
] | [((3409, 3447), 'os.path.join', 'os.path.join', (['image_dir', '"""GroundTruth"""'], {}), "(image_dir, 'GroundTruth')\n", (3421, 3447), False, 'import os\n'), ((2478, 2536), 'os.path.join', 'os.path.join', (['image_dir', '"""ApparentRetinopathy_CLAHE/*.jpg"""'], {}), "(image_dir, 'ApparentRetinopathy_CLAHE/*.jpg')\n", ... |
from src.slu.datareader import domain_set, y1_set, y2_set
from preprocess.gen_embeddings_for_slu import domain2slot
import torch
import torch.nn as nn
import os
from tqdm import tqdm
import numpy as np
import logging
logger = logging.getLogger()
from src.conll2002_metrics import *
class SLUTrainer(object):
def ... | [
"torch.nn.MSELoss",
"torch.argmax",
"torch.nn.CrossEntropyLoss",
"logging.getLogger",
"torch.save",
"src.slu.datareader.y2_set.index",
"torch.optim.Adam",
"torch.autograd.set_detect_anomaly",
"os.path.join",
"numpy.concatenate"
] | [((228, 247), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (245, 247), False, 'import logging\n'), ((1284, 1330), 'torch.optim.Adam', 'torch.optim.Adam', (['model_parameters'], {'lr': 'self.lr'}), '(model_parameters, lr=self.lr)\n', (1300, 1330), False, 'import torch\n'), ((1363, 1384), 'torch.nn.CrossEn... |
import random
import numpy as np
import tensorflow as tf
class Reproducibility:
"""
Singleton class for ensure reproducibility.
You indicates the seed and the execution is the same. The server initialice this class and the clients only
call/get a seed.
Server initialize it with Reproducibility(se... | [
"tensorflow.random.set_seed",
"random.seed",
"numpy.random.randint",
"numpy.random.seed"
] | [((1806, 1838), 'numpy.random.seed', 'np.random.seed', (['self.__seeds[id]'], {}), '(self.__seeds[id])\n', (1820, 1838), True, 'import numpy as np\n'), ((1847, 1876), 'random.seed', 'random.seed', (['self.__seeds[id]'], {}), '(self.__seeds[id])\n', (1858, 1876), False, 'import random\n'), ((1885, 1921), 'tensorflow.ran... |
#!/usr/bin/env python
#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | [
"mock.patch",
"cephlm.cephmetrics.system.hpssacli.HPssaCli.check_hpssacli"
] | [((912, 959), 'mock.patch', 'mock.patch', (['"""swiftlm.hp_hardware.hpssacli.main"""'], {}), "('swiftlm.hp_hardware.hpssacli.main')\n", (922, 959), False, 'import mock\n'), ((1304, 1351), 'mock.patch', 'mock.patch', (['"""swiftlm.hp_hardware.hpssacli.main"""'], {}), "('swiftlm.hp_hardware.hpssacli.main')\n", (1314, 135... |
"""Common utilities for alerts and alert digests."""
import os
from math import floor, log10
from typing import List, Optional, Union
from jinja2 import Environment, FileSystemLoader, select_autoescape
from chaos_genius.alerts.email import send_static_alert_email
from chaos_genius.core.utils.round import round_numbe... | [
"os.path.dirname",
"math.floor",
"jinja2.select_autoescape",
"jinja2.FileSystemLoader",
"chaos_genius.core.utils.round.round_number"
] | [((3179, 3204), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (3194, 3204), False, 'import os\n'), ((3263, 3285), 'jinja2.FileSystemLoader', 'FileSystemLoader', (['path'], {}), '(path)\n', (3279, 3285), False, 'from jinja2 import Environment, FileSystemLoader, select_autoescape\n'), ((3298, ... |
from typing import Any
from pydantic import validator, create_model, AnyHttpUrl
from pydantic.main import BaseModel
from tracardi.domain.entity import Entity
class AwsIamAuth(BaseModel):
aws_access_key_id: str
aws_secret_access_key: str
class Content(BaseModel):
content: str
type: str
@validat... | [
"pydantic.validator"
] | [((313, 333), 'pydantic.validator', 'validator', (['"""content"""'], {}), "('content')\n", (322, 333), False, 'from pydantic import validator, create_model, AnyHttpUrl\n')] |
from rest_framework import permissions
from rest_framework.generics import ListAPIView, CreateAPIView, RetrieveUpdateDestroyAPIView
from rest_framework.exceptions import ValidationError
from inventory.api.serializers import AssetSerializer, BorrowerSerializer, CategorySerializer
from inventory.models import Asset, Borr... | [
"inventory.models.Asset.objects.filter",
"inventory.models.Borrower.objects.filter",
"inventory.models.Category.objects.all",
"inventory.models.Borrower.objects.all",
"inventory.models.Asset.objects.all",
"rest_framework.exceptions.ValidationError"
] | [((1492, 1514), 'inventory.models.Category.objects.all', 'Category.objects.all', ([], {}), '()\n', (1512, 1514), False, 'from inventory.models import Asset, Borrower, Category\n'), ((2891, 2913), 'inventory.models.Category.objects.all', 'Category.objects.all', ([], {}), '()\n', (2911, 2913), False, 'from inventory.mode... |
"""
author: thomaszdxsn
"""
import re
__all__ = ('RE_DATETIME', 'RE_IMG_SRC', 'RE_DATE', 'RE_UNIT_NUM', 'RE_CHINESE')
RE_DATETIME = re.compile(r'\d{2,4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}')
RE_DATE = re.compile(r'\d{2,4}-\d{1,2}-\d{1,2}')
RE_IMG_SRC = re.compile(r'<img\s+src=[\'\"](.*?)[\'\"].*?/?>', flags=re.D... | [
"re.compile"
] | [((135, 202), 're.compile', 're.compile', (['"""\\\\d{2,4}-\\\\d{1,2}-\\\\d{1,2} \\\\d{1,2}:\\\\d{1,2}:\\\\d{1,2}"""'], {}), "('\\\\d{2,4}-\\\\d{1,2}-\\\\d{1,2} \\\\d{1,2}:\\\\d{1,2}:\\\\d{1,2}')\n", (145, 202), False, 'import re\n'), ((208, 248), 're.compile', 're.compile', (['"""\\\\d{2,4}-\\\\d{1,2}-\\\\d{1,2}"""'],... |
# File : GetUniqueId.py
# Subprogram to generate a unique id for Pubnub message
# Author: <NAME>
import uuid
def GenerateId():
unique_id=uuid.uuid1()
str_id=str(unique_id)
return str_id
| [
"uuid.uuid1"
] | [((140, 152), 'uuid.uuid1', 'uuid.uuid1', ([], {}), '()\n', (150, 152), False, 'import uuid\n')] |