code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
"""
MagPy
Input filter for IONOMETER data
Written by <NAME> December 2015
- contains test and read function, no write function
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
from io import open
from magpy.stream ... | [
"io.open"
] | [((1088, 1120), 'io.open', 'open', (['filename', '"""rt"""'], {'newline': '""""""'}), "(filename, 'rt', newline='')\n", (1092, 1120), False, 'from io import open\n'), ((435, 455), 'io.open', 'open', (['filename', '"""rt"""'], {}), "(filename, 'rt')\n", (439, 455), False, 'from io import open\n')] |
from typing import List
import logging
import json
import random
import pandas as pd
from tqdm import tqdm
from haystack.schema import Document, Label
from haystack.modeling.data_handler.processor import _read_squad_file
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
tqdm... | [
"pandas.DataFrame",
"json.dump",
"logging.basicConfig",
"random.sample",
"pandas.merge",
"tqdm.tqdm.pandas",
"haystack.schema.Document",
"pandas.DataFrame.from_records",
"haystack.modeling.data_handler.processor._read_squad_file",
"pandas.concat",
"logging.getLogger"
] | [((225, 246), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (244, 246), False, 'import logging\n'), ((256, 283), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (273, 283), False, 'import logging\n'), ((316, 329), 'tqdm.tqdm.pandas', 'tqdm.pandas', ([], {}), '()\n', (327,... |
import databases
import pytest
import sqlalchemy
from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.testclient import TestClient
DATABASE_URL = "sqlite:///test.db"
metadata = sqlalchemy.MetaData()
notes = sqlalchemy.Table(
"notes",
metadata,
sqlalche... | [
"sqlalchemy.MetaData",
"starlette.applications.Starlette",
"starlette.testclient.TestClient",
"sqlalchemy.select",
"sqlalchemy.String",
"pytest.fixture",
"starlette.responses.JSONResponse",
"pytest.raises",
"sqlalchemy.Column",
"databases.Database",
"sqlalchemy.create_engine",
"pytest.mark.use... | [((232, 253), 'sqlalchemy.MetaData', 'sqlalchemy.MetaData', ([], {}), '()\n', (251, 253), False, 'import sqlalchemy\n'), ((510, 552), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""no_trio_support"""'], {}), "('no_trio_support')\n", (533, 552), False, 'import pytest\n'), ((556, 600), 'pytest.fixture', 'pyt... |
from matplotlib.dates import date2num, num2date
from matplotlib.colors import ListedColormap
from matplotlib import dates as mdates
from matplotlib.patches import Patch
from matplotlib import pyplot as plt
from matplotlib import ticker
import os
def plot_fit(df_fit, df_data, y_label='Deaths', y_lim_up = 200, color='b... | [
"matplotlib.dates.MonthLocator",
"matplotlib.dates.DayLocator",
"matplotlib.ticker.StrMethodFormatter",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"matplotlib.dates.WeekdayLocator",
"matplotlib.dates.DateFormatter",
"matplotlib.pyplot.tight_layout"
] | [((1258, 1308), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(2)'], {'figsize': '(20, 7)', 'sharey': 'sharey'}), '(1, 2, figsize=(20, 7), sharey=sharey)\n', (1270, 1308), True, 'from matplotlib import pyplot as plt\n'), ((4867, 4885), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (4... |
from django.core.management.base import BaseCommand
from django.db.utils import OperationalError
from customers.models import Customer
from geolocation.models import Location
import csv
import sys
class Command(BaseCommand):
"""
Command that populates the Customers table
"""
def __init__(self, *arg... | [
"sys.stdout.write",
"csv.DictReader",
"geolocation.models.Location.objects.get_or_create",
"customers.models.Customer.objects.get",
"customers.models.Customer.objects.get_or_create"
] | [((524, 562), 'sys.stdout.write', 'sys.stdout.write', (['"""Populating db...\n"""'], {}), "('Populating db...\\n')\n", (540, 562), False, 'import sys\n'), ((1429, 1463), 'sys.stdout.write', 'sys.stdout.write', (['"""Db populated\n"""'], {}), "('Db populated\\n')\n", (1445, 1463), False, 'import sys\n'), ((1571, 1591), ... |
# source : https://github.com/squeaky-pl/japronto/blob/master/tutorial/1_hello.md
from japronto import Application
def hello(request):
return request.Response(text='Hello world!')
app = Application()
app.router.add_route('/', hello)
app.run(debug=True)
| [
"japronto.Application"
] | [((195, 208), 'japronto.Application', 'Application', ([], {}), '()\n', (206, 208), False, 'from japronto import Application\n')] |
from pathlib import Path
HOME = Path(__file__).parent.parent
DOC = HOME / 'doc'
MAN = HOME / 'man/man1'
| [
"pathlib.Path"
] | [((33, 47), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (37, 47), False, 'from pathlib import Path\n')] |
import json
import os
import shutil
import tempfile
from time import time
from .compat import is_win32
try:
import xbmc
import xbmcvfs
is_kodi = True
except ImportError:
is_kodi = False
if is_win32 and not is_kodi:
xdg_cache = os.environ.get("APPDATA",
os.path.expan... | [
"json.dump",
"xbmcvfs.mkdirs",
"xbmc.translatePath",
"os.remove",
"os.path.join",
"tempfile.mkstemp",
"json.load",
"os.path.dirname",
"os.path.exists",
"time.time",
"xbmcvfs.exists",
"shutil.move",
"os.fdopen",
"os.path.expanduser"
] | [((650, 684), 'os.path.join', 'os.path.join', (['xdg_cache', '"""livecli"""'], {}), "(xdg_cache, 'livecli')\n", (662, 684), False, 'import os\n'), ((752, 799), 'os.path.join', 'os.path.join', (['temp_dir', '"""script.module.livecli"""'], {}), "(temp_dir, 'script.module.livecli')\n", (764, 799), False, 'import os\n'), (... |
from synapse.api.errors import Codes, LoginError, SynapseError
from synapse.api.ratelimiting import Ratelimiter
from synapse.http.server import finish_request
from synapse.http.servlet import (
RestServlet,
parse_json_object_from_request,
parse_string,
)
from synapse.http.site import SynapseRequest
from syn... | [
"synapse.rest.well_known.WellKnownBuilder",
"synapse.http.servlet.parse_json_object_from_request",
"synapse.rest.client.v2_alpha._base.client_patterns"
] | [((618, 654), 'synapse.rest.client.v2_alpha._base.client_patterns', 'client_patterns', (['"""/custom$"""'], {'v1': '(True)'}), "('/custom$', v1=True)\n", (633, 654), False, 'from synapse.rest.client.v2_alpha._base import client_patterns\n'), ((1296, 1316), 'synapse.rest.well_known.WellKnownBuilder', 'WellKnownBuilder',... |
import numpy as np
from copy import deepcopy
from numpy.random import randint
def TournamentSelect( population, how_many_to_select, tournament_size=4 ):
pop_size = len(population)
selection = []
while len(selection) < how_many_to_select:
best = population[randint(pop_size)]
for i in range(tournament_size - 1)... | [
"copy.deepcopy",
"numpy.random.randint"
] | [((533, 547), 'copy.deepcopy', 'deepcopy', (['best'], {}), '(best)\n', (541, 547), False, 'from copy import deepcopy\n'), ((264, 281), 'numpy.random.randint', 'randint', (['pop_size'], {}), '(pop_size)\n', (271, 281), False, 'from numpy.random import randint\n'), ((349, 366), 'numpy.random.randint', 'randint', (['pop_s... |
from posthog.settings.utils import get_from_env, str_to_bool
CONSTANCE_BACKEND = "constance.backends.database.DatabaseBackend"
CONSTANCE_DATABASE_PREFIX = "constance:posthog:"
CONSTANCE_CONFIG = {
"MATERIALIZED_COLUMNS_ENABLED": (
get_from_env("MATERIALIZED_COLUMNS_ENABLED", True, type_cast=str_to_bool),... | [
"posthog.settings.utils.get_from_env"
] | [((246, 319), 'posthog.settings.utils.get_from_env', 'get_from_env', (['"""MATERIALIZED_COLUMNS_ENABLED"""', '(True)'], {'type_cast': 'str_to_bool'}), "('MATERIALIZED_COLUMNS_ENABLED', True, type_cast=str_to_bool)\n", (258, 319), False, 'from posthog.settings.utils import get_from_env, str_to_bool\n'), ((476, 562), 'po... |
"""
"""
## python imports
from argparse import ArgumentParser
from datetime import datetime, timedelta
from enum import IntEnum
from os.path import abspath, dirname, join
## internal imports
from geodeconstructor.history.json import generate_location_history_json
from geodeconstructor.history.locations import iter... | [
"geodeconstructor.history.json.generate_location_history_json",
"geodeconstructor.history.locations.iter_unique_path_by_attribute",
"datetime.datetime.fromisoformat",
"argparse.ArgumentParser",
"os.path.dirname",
"datetime.timedelta",
"datetime.datetime.fromtimestamp",
"simplekml.IconStyle"
] | [((386, 402), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (400, 402), False, 'from argparse import ArgumentParser\n'), ((3386, 3431), 'geodeconstructor.history.json.generate_location_history_json', 'generate_location_history_json', (['args.filepath'], {}), '(args.filepath)\n', (3416, 3431), False, 'f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy, os
import SimpleHTTPServer
def kill():
os.system("kill -KILL " + str(os.getpid()))
os.chdir(os.path.dirname(__file__))
rospy.init_node("webserver")
rospy.on_shutdown(kill)
SimpleHTTPServer.test()
| [
"os.getpid",
"SimpleHTTPServer.test",
"os.path.dirname",
"rospy.on_shutdown",
"rospy.init_node"
] | [((185, 213), 'rospy.init_node', 'rospy.init_node', (['"""webserver"""'], {}), "('webserver')\n", (200, 213), False, 'import rospy, os\n'), ((214, 237), 'rospy.on_shutdown', 'rospy.on_shutdown', (['kill'], {}), '(kill)\n', (231, 237), False, 'import rospy, os\n'), ((238, 261), 'SimpleHTTPServer.test', 'SimpleHTTPServer... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Written by <NAME> and CBIG under MIT license:
https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
"""
import os
import numpy as np
class config:
BASE_DIR = '../../../../../../data/fmri_predict_behavior'
CUR_DIR = os.getcwd()
INTER_DIR = os.path.j... | [
"os.getcwd",
"os.path.join",
"numpy.sum"
] | [((283, 294), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (292, 294), False, 'import os\n'), ((311, 348), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""He2019_data"""'], {}), "(BASE_DIR, 'He2019_data')\n", (323, 348), False, 'import os\n'), ((368, 400), 'os.path.join', 'os.path.join', (['INTER_DIR', '"""graph"""'],... |
# Copyright (C) 2013 Ion Torrent Systems, Inc. All Rights Reserved
from django import http
from django.contrib.auth.decorators import login_required
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404, \
get_list_or_404
from django.conf import settings
from... | [
"iondb.rundb.models.PlannedExperiment.objects.filter",
"sample_validator.validate_sample_for_sampleSet",
"iondb.rundb.models.SampleSet.objects.all",
"csv.reader",
"views_helper._get_pcrPlateRow_choices",
"os.unlink",
"iondb.rundb.models.SamplePrepData.objects.create",
"iondb.rundb.models.SampleSet.obj... | [((1399, 1426), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1416, 1426), False, 'import logging\n'), ((1744, 1808), 'django.http.HttpResponse', 'HttpResponse', (['"""Manually Entered Sample session has been cleared"""'], {}), "('Manually Entered Sample session has been cleared')\n", (... |
import pytest
from unittest import mock
from aiogear import Worker, PacketType
@pytest.fixture(scope='function')
def worker():
w = Worker()
w.get_task = mock.Mock()
return w
def test_register_function_connected(worker):
written = None
def _write(data):
nonlocal written
written =... | [
"aiogear.Worker",
"unittest.mock.Mock",
"pytest.fixture",
"pytest.mark.xfail"
] | [((82, 114), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (96, 114), False, 'import pytest\n'), ((554, 592), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'raises': 'RuntimeError'}), '(raises=RuntimeError)\n', (571, 592), False, 'import pytest\n'), ((137, 145), 'aioge... |
#!/usr/bin/env python
import numpy as np
from parameters import *
from snn import TargetFollowingSNN, ObstacleAvoidanceSNN, nest_simulate
class Model:
def __init__(self):
self.snn_tf = TargetFollowingSNN()
self.snn_oa = ObstacleAvoidanceSNN()
self.turn_pre = 0.0
self.angle_pre = 0.0
self.weights_tf = []
... | [
"snn.ObstacleAvoidanceSNN",
"numpy.any",
"snn.TargetFollowingSNN",
"snn.nest_simulate",
"numpy.sign"
] | [((192, 212), 'snn.TargetFollowingSNN', 'TargetFollowingSNN', ([], {}), '()\n', (210, 212), False, 'from snn import TargetFollowingSNN, ObstacleAvoidanceSNN, nest_simulate\n'), ((229, 251), 'snn.ObstacleAvoidanceSNN', 'ObstacleAvoidanceSNN', ([], {}), '()\n', (249, 251), False, 'from snn import TargetFollowingSNN, Obst... |
"""
@author: <NAME> <<EMAIL>>
"""
import os
import pickle
import shutil
from datetime import datetime
from copy import deepcopy
from itertools import combinations
import heapq
import numpy
class SequenceStruct(object):
r"""class for representing each sequence/segment
Args:
Y: list containin... | [
"os.remove",
"pickle.dump",
"heapq.heappush",
"os.path.isfile",
"pickle.load",
"numpy.arange",
"numpy.exp",
"shutil.rmtree",
"os.path.join",
"os.path.dirname",
"os.path.exists",
"numpy.append",
"numpy.max",
"datetime.datetime.now",
"copy.deepcopy",
"numpy.ceil",
"os.path.realpath",
... | [((44522, 44546), 'os.path.isdir', 'os.path.isdir', (['directory'], {}), '(directory)\n', (44535, 44546), False, 'import os\n'), ((44622, 44646), 'os.path.isfile', 'os.path.isfile', (['filepath'], {}), '(filepath)\n', (44636, 44646), False, 'import os\n'), ((45305, 45348), 'os.path.join', 'os.path.join', (['path_curren... |
"""
Runner for a Celery Python function
"""
from __future__ import absolute_import
import time
from uuid import uuid4
from importlib import import_module
from ..event import BaseEvent
from ..utils import add_data_if_needed
class CeleryRunner(BaseEvent):
"""
Represents Python Celery event runner.
"""
... | [
"uuid.uuid4",
"importlib.import_module",
"time.time"
] | [((614, 625), 'time.time', 'time.time', ([], {}), '()\n', (623, 625), False, 'import time\n'), ((656, 663), 'uuid.uuid4', 'uuid4', ([], {}), '()\n', (661, 663), False, 'from uuid import uuid4\n'), ((876, 899), 'importlib.import_module', 'import_module', (['"""celery"""'], {}), "('celery')\n", (889, 899), False, 'from i... |
import logging
import json
from shelvery.factory import ShelveryFactory
def lambda_handler(event, context):
logger = logging.getLogger()
logger.setLevel(logging.INFO)
logger.info(f"Received event\n{json.dumps(event,indent=2)}")
if 'backup_type' not in event:
raise Exception("Expectin... | [
"shelvery.factory.ShelveryFactory.get_shelvery_instance",
"logging.getLogger",
"json.dumps"
] | [((128, 147), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (145, 147), False, 'import logging\n'), ((610, 660), 'shelvery.factory.ShelveryFactory.get_shelvery_instance', 'ShelveryFactory.get_shelvery_instance', (['backup_type'], {}), '(backup_type)\n', (647, 660), False, 'from shelvery.factory import She... |
import io
from nose.tools import assert_equal
from tests.shared import SampleFlatConfiguration
CONFIGURATION_FULL_DATA = io.StringIO("""
[app_config]
required_str_param: spam
optional_str_param: eggs
default_str_param: sausage
required_int_param: 42
""")
CONFIGURATION_PARTIAL_DATA = io.StringIO("""
[app_config]
re... | [
"tests.shared.SampleFlatConfiguration.load",
"io.StringIO",
"nose.tools.assert_equal"
] | [((124, 267), 'io.StringIO', 'io.StringIO', (['"""\n[app_config]\nrequired_str_param: spam\noptional_str_param: eggs\ndefault_str_param: sausage\nrequired_int_param: 42\n"""'], {}), '(\n """\n[app_config]\nrequired_str_param: spam\noptional_str_param: eggs\ndefault_str_param: sausage\nrequired_int_param: 42\n"""\n ... |
from __future__ import annotations
from dataclasses import dataclass
from anytree import NodeMixin
from typing import Optional
from slugify import slugify
pattern_ltree_compatible = "[^-a-z0-9_]+"
def identifier_from_string(a_string: str) -> str:
return slugify(a_string, regex_pattern=pattern_ltree_compatible, se... | [
"slugify.slugify"
] | [((260, 332), 'slugify.slugify', 'slugify', (['a_string'], {'regex_pattern': 'pattern_ltree_compatible', 'separator': '"""_"""'}), "(a_string, regex_pattern=pattern_ltree_compatible, separator='_')\n", (267, 332), False, 'from slugify import slugify\n')] |
# -*- coding: utf-8 -*-
# (c) Copyright IBM Corp. 2018. All Rights Reserved.
# pragma pylint: disable=unused-argument, no-self-use, line-too-long
""" Resilient functions component to execute queries against an LDAP server """
import logging
import json
import re
from resilient_circuits import ResilientComponent, func... | [
"resilient_circuits.function",
"resilient_circuits.handler",
"resilient_circuits.StatusMessage",
"ldap3.utils.conv.escape_filter_chars",
"fn_ldap_utilities.util.helper.LDAPUtilitiesHelper",
"resilient_circuits.FunctionError",
"resilient_circuits.FunctionResult",
"re.search",
"logging.getLogger"
] | [((2296, 2313), 'resilient_circuits.handler', 'handler', (['"""reload"""'], {}), "('reload')\n", (2303, 2313), False, 'from resilient_circuits import ResilientComponent, function, handler, StatusMessage, FunctionResult, FunctionError\n'), ((2479, 2512), 'resilient_circuits.function', 'function', (['"""ldap_utilities_se... |
"""Test configuration fragment replacement."""
import pytest
from dictator.validators.replace import (
FragmentReplace,
AutoFragmentReplace,
FragmentError,
)
from dictator.validators.lists import SubListValidator
from dictator.config import validate_config
def test_fragment_replace():
"""Test manual ... | [
"dictator.config.validate_config",
"dictator.validators.replace.AutoFragmentReplace",
"pytest.raises",
"dictator.validators.replace.FragmentReplace"
] | [((578, 616), 'dictator.config.validate_config', 'validate_config', (['TEST_CONFIG', 'TEST_REQ'], {}), '(TEST_CONFIG, TEST_REQ)\n', (593, 616), False, 'from dictator.config import validate_config\n'), ((887, 925), 'dictator.config.validate_config', 'validate_config', (['TEST_CONFIG', 'TEST_REQ'], {}), '(TEST_CONFIG, TE... |
import asyncio
import json
import logging
import queue
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime, timedelta
from typing import Dict, Tuple, List
from cincanregistry.models.tool_info import ToolInfo
from cincanregistry.models.version_info import VersionInfo, VersionType
from .check... | [
"asyncio.gather",
"json.load",
"asyncio.get_event_loop",
"datetime.timedelta",
"concurrent.futures.ThreadPoolExecutor",
"datetime.datetime.now",
"queue.Queue",
"logging.getLogger"
] | [((856, 885), 'logging.getLogger', 'logging.getLogger', (['"""versions"""'], {}), "('versions')\n", (873, 885), False, 'import logging\n'), ((1606, 1619), 'queue.Queue', 'queue.Queue', ([], {}), '()\n', (1617, 1619), False, 'import queue\n'), ((4492, 4506), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (45... |
from dataclasses import dataclass, field
import os
import glob
from typing import Any, Dict, List, Optional
from monosi.reporter import Reporter
import monosi.utils.yaml as yaml
@dataclass
class ProjectConfigurationDefaults:
version: str = '0.0.1' # TODO: Update to automatic
collection_name: Optional[str] = ... | [
"os.getcwd",
"dataclasses.field",
"monosi.utils.yaml.parse_file",
"os.path.normpath",
"glob.glob",
"os.path.join"
] | [((394, 440), 'dataclasses.field', 'field', ([], {'default_factory': "(lambda : ['./monitors'])"}), "(default_factory=lambda : ['./monitors'])\n", (399, 440), False, 'from dataclasses import dataclass, field\n'), ((465, 496), 'dataclasses.field', 'field', ([], {'default_factory': 'Reporter'}), '(default_factory=Reporte... |
import unittest
from .type import EnumType, ValueType
from .spec import TypeSpec, ProductionSpec, PredicateSpec
class TestTrinitySpec(unittest.TestCase):
def test_type(self):
ty0 = EnumType('Type0')
ty1 = ValueType('Type1')
spec = TypeSpec()
spec.define_type(ty0)
spec.defi... | [
"unittest.main"
] | [((2794, 2809), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2807, 2809), False, 'import unittest\n')] |
#!/usr/bin/env python3
from broker import cfg
from broker._utils.tools import log
from broker._utils.web3_tools import get_tx_status
from broker.config import env
from broker.errors import QuietExit
from broker.utils import print_tb
def _update_data_price():
Ebb = cfg.Ebb
if not Ebb.does_provider_exist(env.P... | [
"broker.cfg.Ebb.get_registered_data_prices",
"broker._utils.tools.log",
"broker.cfg.w3.toBytes",
"broker.utils.print_tb"
] | [((578, 615), 'broker.cfg.w3.toBytes', 'cfg.w3.toBytes', ([], {'text': 'source_code_hash'}), '(text=source_code_hash)\n', (592, 615), False, 'from broker import cfg\n'), ((341, 405), 'broker._utils.tools.log', 'log', (['f"""Warning: Provider {env.PROVIDER_ID} is not registered.\n"""'], {}), "(f'Warning: Provider {env.P... |
#!/usr/bin/env python
import os
import jinja2
import yaml
PATH = os.path.dirname(os.path.abspath(__file__))
TEMPLATE_ENVIRONMENT = jinja2.Environment(
autoescape=False,
loader=jinja2.FileSystemLoader(os.path.join(PATH, 'data')),
trim_blocks=False)
def render_template(template_filename, context):
ret... | [
"os.path.abspath",
"yaml.load",
"os.path.join"
] | [((83, 108), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (98, 108), False, 'import os\n'), ((424, 462), 'os.path.join', 'os.path.join', (['"""content"""', '"""showcase.md"""'], {}), "('content', 'showcase.md')\n", (436, 462), False, 'import os\n'), ((210, 236), 'os.path.join', 'os.path.joi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by <EMAIL> on 2017/11/6
"""
工程引导文件
开发运行
数据库创建更新
工程自定义命令
"""
import os
import unittest
# 代码覆盖率测量库
import coverage
# 自定义命令库
from flask_script import Manager
# 数据库表结构迁移库(将model修改同步修改数据库表结构)
from flask_migrate import Migrate, MigrateCommand
COV = coverage.coverage(... | [
"unittest.TextTestRunner",
"coverage.coverage",
"flask_script.Manager",
"os.path.dirname",
"app.db.create_engine",
"app.db.drop_all",
"flask_migrate.Migrate",
"unittest.TestLoader",
"app.db.create_all",
"os.path.join",
"unittest.TestLoader.discover"
] | [((302, 413), 'coverage.coverage', 'coverage.coverage', ([], {'branch': '(True)', 'include': '"""app/*"""', 'omit': "['app/tests/*', 'app/config.py', 'app/*/__init__.py']"}), "(branch=True, include='app/*', omit=['app/tests/*',\n 'app/config.py', 'app/*/__init__.py'])\n", (319, 413), False, 'import coverage\n'), ((5... |
import time
from wraptor.decorators import timeout, TimeoutException
def test_basic():
@timeout(1)
def fn():
try:
time.sleep(2)
assert False
except TimeoutException:
pass
fn()
def test_catch_exception_outsize():
@timeout(1)
def fn():
tim... | [
"wraptor.decorators.timeout",
"time.sleep"
] | [((94, 104), 'wraptor.decorators.timeout', 'timeout', (['(1)'], {}), '(1)\n', (101, 104), False, 'from wraptor.decorators import timeout, TimeoutException\n'), ((284, 294), 'wraptor.decorators.timeout', 'timeout', (['(1)'], {}), '(1)\n', (291, 294), False, 'from wraptor.decorators import timeout, TimeoutException\n'), ... |
#! /usr/bin/python
# coding: utf-8
# flake8: noqa
# This file is part of PyRemo. PyRemo is a toolbox to facilitate
# treatment and plotting of REMO or other rotated and non-rotated
# data.
#
# Copyright (C) 2010-2020 REMO Group
# See COPYING file for copying and redistribution conditions.
#
# This program is free softw... | [
"cordex.domain_info",
"cordex.cordex_domain",
"itertools.product"
] | [((1767, 1827), 'cordex.cordex_domain', 'cx.cordex_domain', (['short_name'], {'tables': 'domains.table'}), '(short_name, tables=domains.table, **kwargs)\n', (1783, 1827), True, 'import cordex as cx\n'), ((2227, 2275), 'cordex.domain_info', 'cx.domain_info', (['short_name'], {'tables': 'domains.table'}), '(short_name, t... |
from node.myownp2pn import MyOwnPeer2PeerNode
from lib.settings import the_settings
def ndstart(port):
node = MyOwnPeer2PeerNode("",port)
node.debug = the_settings().debug_mode()
node.start()
def ndstop():
MyOwnPeer2PeerNode.main_node.stop()
def ndconnect(ip,port):
MyOwnPeer2PeerNode.main_no... | [
"lib.settings.the_settings",
"node.myownp2pn.MyOwnPeer2PeerNode.main_node.connectionfrommix_blockchain_network",
"node.myownp2pn.MyOwnPeer2PeerNode",
"node.myownp2pn.MyOwnPeer2PeerNode.main_node.stop",
"node.myownp2pn.MyOwnPeer2PeerNode.main_node.connect_with_node"
] | [((115, 143), 'node.myownp2pn.MyOwnPeer2PeerNode', 'MyOwnPeer2PeerNode', (['""""""', 'port'], {}), "('', port)\n", (133, 143), False, 'from node.myownp2pn import MyOwnPeer2PeerNode\n'), ((229, 264), 'node.myownp2pn.MyOwnPeer2PeerNode.main_node.stop', 'MyOwnPeer2PeerNode.main_node.stop', ([], {}), '()\n', (262, 264), Fa... |
"""Tests for the Device Registry."""
import pytest
from homeassistant.helpers import device_registry
def mock_registry(hass, mock_entries=None):
"""Mock the Device Registry."""
registry = device_registry.DeviceRegistry(hass)
registry.devices = mock_entries or []
async def _get_reg():
return ... | [
"homeassistant.helpers.device_registry.async_get_registry",
"homeassistant.helpers.device_registry.DeviceRegistry"
] | [((199, 235), 'homeassistant.helpers.device_registry.DeviceRegistry', 'device_registry.DeviceRegistry', (['hass'], {}), '(hass)\n', (229, 235), False, 'from homeassistant.helpers import device_registry\n'), ((2382, 2422), 'homeassistant.helpers.device_registry.async_get_registry', 'device_registry.async_get_registry', ... |
"""test unit for utils/data_iterator.py"""
import runtime_path # isort:skip
import numpy as np
from utils.data_iterator import BatchIterator
def test_batch_iterator():
batch_size = 10
n_data = 10 * batch_size # 10 batches
iterator = BatchIterator(batch_size=batch_size)
x_dim, y_dim = 10, 5
fa... | [
"numpy.random.randint",
"utils.data_iterator.BatchIterator"
] | [((252, 288), 'utils.data_iterator.BatchIterator', 'BatchIterator', ([], {'batch_size': 'batch_size'}), '(batch_size=batch_size)\n', (265, 288), False, 'from utils.data_iterator import BatchIterator\n'), ((327, 374), 'numpy.random.randint', 'np.random.randint', (['(0)', '(100)'], {'size': '(n_data, x_dim)'}), '(0, 100,... |
#!/usr/bin/env ipython
"""
Validator script for raft-level PRNU analysis.
"""
import astropy.io.fits as fits
import numpy as np
import lcatr.schema
import siteUtils
import eotestUtils
import camera_components
raft_id = siteUtils.getUnitId()
raft = camera_components.Raft.create_from_etrav(raft_id)
results = []
for slo... | [
"siteUtils.jobInfo",
"eotestUtils.eotestCalibrations",
"eotestUtils.eotestCalibsPersist",
"camera_components.Raft.create_from_etrav",
"siteUtils.getProcessName",
"astropy.io.fits.open",
"numpy.round",
"siteUtils.getUnitId"
] | [((220, 241), 'siteUtils.getUnitId', 'siteUtils.getUnitId', ([], {}), '()\n', (239, 241), False, 'import siteUtils\n'), ((249, 298), 'camera_components.Raft.create_from_etrav', 'camera_components.Raft.create_from_etrav', (['raft_id'], {}), '(raft_id)\n', (289, 298), False, 'import camera_components\n'), ((1405, 1424), ... |
from data.detection.voc import VOCDataset
from neodroidvision.detection.single_stage.ssd.config.ssd_base_config import base_cfg
base_cfg.data_dir = base_cfg.data_dir / "PASCAL" / "Train"
base_cfg.model.backbone.update(out_channels=(512, 1024, 512, 256, 256, 256, 256))
base_cfg.model.box_head.priors.update(
featu... | [
"neodroidvision.detection.single_stage.ssd.config.ssd_base_config.base_cfg.model.box_head.priors.update",
"neodroidvision.detection.single_stage.ssd.config.ssd_base_config.base_cfg.solver.update",
"neodroidvision.detection.single_stage.ssd.config.ssd_base_config.base_cfg.datasets.update",
"neodroidvision.dete... | [((190, 275), 'neodroidvision.detection.single_stage.ssd.config.ssd_base_config.base_cfg.model.backbone.update', 'base_cfg.model.backbone.update', ([], {'out_channels': '(512, 1024, 512, 256, 256, 256, 256)'}), '(out_channels=(512, 1024, 512, 256, 256, 256,\n 256))\n', (220, 275), False, 'from neodroidvision.detecti... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from future import standard_library
standard_library.install_aliases()
from builtins import next
from builtins import map
from builtins import range
from builtins import *... | [
"future.standard_library.install_aliases",
"itertools.count",
"builtins.next",
"boolean2.boolmodel.BoolModel.initialize",
"boolean2.util.list_gcd",
"boolean2.boolmodel.BoolModel.state_update",
"builtins.map",
"builtins.range",
"boolean2.util.error"
] | [((185, 219), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (217, 219), False, 'from future import standard_library\n'), ((2424, 2432), 'itertools.count', 'count', (['(0)'], {}), '(0)\n', (2429, 2432), False, 'from itertools import count\n'), ((586, 648), 'boolean2.boo... |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
dataset = pd.read_csv('train.csv')
X = dataset.iloc[:, 1:4].values
y = dataset.iloc[:, 0].values
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
labelencoder_X_1 = LabelEncoder()
X[:, 2] = labelencoder_X_1.fit_transform(X[:, 2])
oneh... | [
"pandas.DataFrame",
"sklearn.tree.DecisionTreeRegressor",
"pandas.read_csv",
"sklearn.preprocessing.OneHotEncoder",
"sklearn.preprocessing.LabelEncoder",
"numpy.row_stack",
"numpy.column_stack"
] | [((82, 106), 'pandas.read_csv', 'pd.read_csv', (['"""train.csv"""'], {}), "('train.csv')\n", (93, 106), True, 'import pandas as pd\n'), ((251, 265), 'sklearn.preprocessing.LabelEncoder', 'LabelEncoder', ([], {}), '()\n', (263, 265), False, 'from sklearn.preprocessing import LabelEncoder, OneHotEncoder\n'), ((332, 371),... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from ..functional import epipolar as E
class PerspectiveTransformerLayer(nn.Module):
def __init__(self, bv_size, pv_size, intrinsics, translate_z = -10.0, rotation_order='xyz', device='cuda:0', dtype=torch.float32):
'''... | [
"torch.ones_like",
"torch.arange",
"torch.device",
"torch.inverse",
"torch.matmul",
"torch.tensor"
] | [((1783, 1877), 'torch.tensor', 'torch.tensor', (['[[bv_size[1] / 2.0], [bv_size[0]], [1.0]]'], {'device': 'self.dev', 'dtype': 'self.dtype'}), '([[bv_size[1] / 2.0], [bv_size[0]], [1.0]], device=self.dev,\n dtype=self.dtype)\n', (1795, 1877), False, 'import torch\n'), ((1891, 1985), 'torch.tensor', 'torch.tensor', ... |
#!/usr/bin/env python3
"""Module containing the ClassificationPredict class and the command line interface."""
import argparse
import pandas as pd
import joblib
from biobb_common.generic.biobb_object import BiobbObject
from sklearn.preprocessing import StandardScaler
from sklearn import linear_model
from sklearn.neigh... | [
"pandas.DataFrame",
"biobb_common.configuration.settings.ConfReader",
"pandas.read_csv",
"argparse.RawTextHelpFormatter",
"biobb_common.tools.file_utils.log",
"joblib.load"
] | [((5904, 6011), 'biobb_common.tools.file_utils.log', 'fu.log', (["('Getting model from %s' % self.io_dict['in']['input_model_path'])", 'self.out_log', 'self.global_log'], {}), "('Getting model from %s' % self.io_dict['in']['input_model_path'],\n self.out_log, self.global_log)\n", (5910, 6011), True, 'from biobb_comm... |
# Copyright (c) 2013 AndroWiiid <<EMAIL>>
# Copyright (c) 2014-2016, 2018-2019 <NAME> <<EMAIL>>
# Copyright (c) 2014 Google, Inc.
# Copyright (c) 2015-2016 Ceridwen <<EMAIL>>
# Copyright (c) 2018 <NAME> <<EMAIL>>
# Copyright (c) 2018 <NAME> <<EMAIL>>
# Copyright (c) 2019 <NAME> <<EMAIL>>
# Licensed under the LGPL: htt... | [
"unittest.main",
"platform.python_implementation",
"astroid.raw_building.build_class",
"astroid.test_utils.require_version",
"astroid.builder.AstroidBuilder",
"astroid.raw_building.attach_dummy_node",
"astroid.raw_building.build_from_import",
"astroid.raw_building.build_function",
"astroid.raw_build... | [((2515, 2555), 'astroid.test_utils.require_version', 'test_utils.require_version', ([], {'minver': '"""3.0"""'}), "(minver='3.0')\n", (2541, 2555), False, 'from astroid import test_utils\n'), ((3104, 3119), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3117, 3119), False, 'import unittest\n'), ((803, 827), 'ast... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The base information profile.
"""
from abc import ABCMeta, abstractmethod
from six import with_metaclass
import numpy as np
profile_docstring = """
{name}
Static Attributes
-----------------
xlabel : str
The label for the x-axis when plotting.
ylabel : str
... | [
"numpy.isclose",
"matplotlib.pyplot.figure",
"six.with_metaclass"
] | [((613, 644), 'six.with_metaclass', 'with_metaclass', (['ABCMeta', 'object'], {}), '(ABCMeta, object)\n', (627, 644), False, 'from six import with_metaclass\n'), ((2394, 2424), 'numpy.isclose', 'np.isclose', (['low', '(0)'], {'atol': '(1e-05)'}), '(low, 0, atol=1e-05)\n', (2404, 2424), True, 'import numpy as np\n'), ((... |
from cumulusci.salesforce_api.metadata import ApiRetrieveUnpackaged
from cumulusci.tasks.salesforce import BaseRetrieveMetadata
retrieve_unpackaged_options = BaseRetrieveMetadata.task_options.copy()
retrieve_unpackaged_options.update(
{
"package_xml": {
"description": "The path to a package.xm... | [
"cumulusci.tasks.salesforce.BaseRetrieveMetadata.task_options.copy"
] | [((160, 200), 'cumulusci.tasks.salesforce.BaseRetrieveMetadata.task_options.copy', 'BaseRetrieveMetadata.task_options.copy', ([], {}), '()\n', (198, 200), False, 'from cumulusci.tasks.salesforce import BaseRetrieveMetadata\n')] |
from GeneralUtils import flatten
def collatz(n):
while n > 1:
yield n
if n % 2 == 0:
n = n//2
else:
n = 3*n+1
yield n
def collatz_inv(n):
if n % 6 == 4:
return 2*n, (n-1)//3
return 2*n
def collatz_inv_graph(n,levels):
S = [n]
for i in ra... | [
"GeneralUtils.flatten"
] | [((385, 395), 'GeneralUtils.flatten', 'flatten', (['S'], {}), '(S)\n', (392, 395), False, 'from GeneralUtils import flatten\n'), ((623, 633), 'GeneralUtils.flatten', 'flatten', (['S'], {}), '(S)\n', (630, 633), False, 'from GeneralUtils import flatten\n')] |
# Copyright 2011 OpenStack Foundation
#
# 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 l... | [
"oslo_log.log.getLogger",
"oslo_config.cfg.PortOpt",
"oslo_messaging._drivers.pool.ConnectionPool",
"kombu.messaging.Producer",
"random.shuffle",
"oslo_messaging._drivers.common.deserialize_msg",
"oslo_config.cfg.ListOpt",
"oslo_messaging._i18n._",
"oslo_messaging._drivers.amqp.AMQPDestinationNotFou... | [((8769, 8796), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (8786, 8796), True, 'from oslo_log import log as logging\n'), ((1570, 1821), 'oslo_config.cfg.StrOpt', 'cfg.StrOpt', (['"""kombu_ssl_version"""'], {'default': '""""""', 'deprecated_group': '"""DEFAULT"""', 'help': '"""SSL... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Cisco-IOS-XR-Get-Full-ClearText-Running-Config Console Script.
Copyright (c) 2021 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Cisco Sample
Code License, Version 1.1 (the "License"). You may obtain a copy of the
License at
... | [
"ncclient.manager.connect",
"getpass.getpass"
] | [((1366, 1401), 'getpass.getpass', 'getpass.getpass', (['"""Enter Password: """'], {}), "('Enter Password: ')\n", (1381, 1401), False, 'import getpass\n'), ((1460, 1581), 'ncclient.manager.connect', 'manager.connect', ([], {'host': 'host', 'port': '(830)', 'username': 'username', 'password': 'password', 'hostkey_verify... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"mindspore.context.set_context",
"src.utils.CalculateDice",
"mindspore.Model",
"numpy.zeros",
"numpy.ones",
"src.unet3d_model.UNet3d_",
"mindspore.Tensor",
"src.unet3d_model.UNet3d",
"mindspore.train.serialization.load_checkpoint",
"src.model_utils.moxing_adapter.moxing_wrapper",
"src.utils.crea... | [((1143, 1268), 'mindspore.context.set_context', 'context.set_context', ([], {'mode': 'context.GRAPH_MODE', 'device_target': 'config.device_target', 'save_graphs': '(False)', 'device_id': 'device_id'}), '(mode=context.GRAPH_MODE, device_target=config.\n device_target, save_graphs=False, device_id=device_id)\n', (116... |
# -*- coding: utf-8 -*-
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from tasksmanager.models import SpiderTask
class DefaultCrawlerSpider(CrawlSpider):
name = 'defaultcrawler'
def __init__(self, *args, **kwargs):
self.domain = kwargs.get('domain')
... | [
"scrapy.linkextractors.LinkExtractor",
"tasksmanager.models.SpiderTask.objects.select_related"
] | [((515, 558), 'tasksmanager.models.SpiderTask.objects.select_related', 'SpiderTask.objects.select_related', (['"""spider"""'], {}), "('spider')\n", (548, 558), False, 'from tasksmanager.models import SpiderTask\n'), ((690, 716), 'scrapy.linkextractors.LinkExtractor', 'LinkExtractor', ([], {'unique': '(True)'}), '(uniqu... |
# Logistic Regression
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('../Datasets/advertising.csv')
ind = dataset.iloc[:, [0, 2]].values #independent variables(daily time spent on the site and income)
dep = dataset.iloc[:... | [
"matplotlib.pyplot.title",
"sklearn.metrics.confusion_matrix",
"sklearn.preprocessing.StandardScaler",
"matplotlib.pyplot.show",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.legend",
"sklearn.linear_model.LogisticRegression",
"matplotlib.pyplot.ylabel",
"matplo... | [((155, 197), 'pandas.read_csv', 'pd.read_csv', (['"""../Datasets/advertising.csv"""'], {}), "('../Datasets/advertising.csv')\n", (166, 197), True, 'import pandas as pd\n'), ((515, 572), 'sklearn.model_selection.train_test_split', 'train_test_split', (['ind', 'dep'], {'test_size': '(0.2)', 'random_state': '(0)'}), '(in... |
from Config_Utils.config import config
from sentiment.analyzer import Analyzer
from pykafka import KafkaClient
import json
client = KafkaClient(hosts='127.0.0.1:9092')
tweet_topic = client.topics[bytes('twitterfeed', 'utf-8')]
sentiment_topic = client.topics[bytes('sentimentfeed', 'utf-8')]
sentiment_producer = sent... | [
"sentiment.analyzer.Analyzer",
"json.dumps",
"pykafka.KafkaClient"
] | [((135, 170), 'pykafka.KafkaClient', 'KafkaClient', ([], {'hosts': '"""127.0.0.1:9092"""'}), "(hosts='127.0.0.1:9092')\n", (146, 170), False, 'from pykafka import KafkaClient\n'), ((498, 545), 'sentiment.analyzer.Analyzer', 'Analyzer', (['"""sentiment/default_classifier.pickle"""'], {}), "('sentiment/default_classifier... |
import tweepy
import couchdb
import json
import math
from urllib3.exceptions import ProtocolError
# Twitter API authentication details.
consumer_key = 'ojOqMVHEPmhCiYwTrZIUrPGGW'
consumer_secret = '<KEY>'
access_token = '<KEY>'
access_token_secret = '<KEY>'
auth = tweepy.OAuthHandler(consumer_key, consume... | [
"tweepy.API",
"json.loads",
"couchdb.Server",
"math.floor",
"tweepy.Cursor",
"tweepy.Stream",
"tweepy.OAuthHandler"
] | [((279, 329), 'tweepy.OAuthHandler', 'tweepy.OAuthHandler', (['consumer_key', 'consumer_secret'], {}), '(consumer_key, consumer_secret)\n', (298, 329), False, 'import tweepy\n'), ((397, 438), 'tweepy.API', 'tweepy.API', (['auth'], {'wait_on_rate_limit': '(True)'}), '(auth, wait_on_rate_limit=True)\n', (407, 438), False... |
"""
Faceting with clean axes
========================
Removing axes help visualising patterns in multiple plots
"""
import matplotlib.pyplot as plt
from wavespectra import read_swan
dset = read_swan("../_static/swanfile.spec", as_site=True)
p = (
dset.isel(site=0)
.sel(freq=slice(0, 0.2))
.spec.plot.cont... | [
"wavespectra.read_swan"
] | [((192, 243), 'wavespectra.read_swan', 'read_swan', (['"""../_static/swanfile.spec"""'], {'as_site': '(True)'}), "('../_static/swanfile.spec', as_site=True)\n", (201, 243), False, 'from wavespectra import read_swan\n')] |
from pathlib import Path
import time
import numpy
import psutil
import pytest
from ..client import from_config
from ..server.object_cache import ObjectCache, get_object_cache, NO_CACHE
from ..trees.files import DEFAULT_POLL_INTERVAL
def test_tallying_hits_and_misses():
cache = ObjectCache(1e6)
assert cache.... | [
"psutil.virtual_memory",
"numpy.ones",
"time.sleep",
"pytest.raises",
"pathlib.Path"
] | [((493, 511), 'numpy.ones', 'numpy.ones', (['(5, 5)'], {}), '((5, 5))\n', (503, 511), False, 'import numpy\n'), ((960, 978), 'numpy.ones', 'numpy.ones', (['(5, 5)'], {}), '((5, 5))\n', (970, 978), False, 'import numpy\n'), ((1304, 1322), 'numpy.ones', 'numpy.ones', (['(5, 5)'], {}), '((5, 5))\n', (1314, 1322), False, '... |
from pprint import pprint
done = set(['abs','all','any','ascii','bin','bool','bytearray','bytes','callable','chr','dict','divmod','enumerate','filter','float','frozenset','hex','int','iter','len','list','map','max','min','next','object','oct','ord','pow','range','repr','round','set','sorted','str','sum','tuple','zip']... | [
"pprint.pprint"
] | [((1160, 1189), 'pprint.pprint', 'pprint', (['(all - done - wont_fix)'], {}), '(all - done - wont_fix)\n', (1166, 1189), False, 'from pprint import pprint\n')] |
import time
import struct
from banyan_ch_find import banyan_ch_find
import numpy
import datetime
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), "../submodules/FEED/src/python"))
# Grab the start time early, so things like
# python get_raw_adcs.py | tee `date "+%Y%m%d_%H%M%S"`.log
# will ... | [
"os.mkdir",
"argparse.ArgumentParser",
"numpy.empty",
"numpy.angle",
"numpy.ones",
"datetime.datetime.utcnow",
"numpy.sin",
"os.path.dirname",
"numpy.savetxt",
"os.path.exists",
"datetime.datetime.now",
"struct.unpack",
"time.sleep",
"banyan_ch_find.banyan_ch_find",
"numpy.cos",
"sys.e... | [((370, 393), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (391, 393), False, 'import datetime\n'), ((955, 979), 'banyan_ch_find.banyan_ch_find', 'banyan_ch_find', (['mask_int'], {}), '(mask_int)\n', (969, 979), False, 'from banyan_ch_find import banyan_ch_find\n'), ((3159, 3175), 'numpy.array', ... |
from setuptools import setup, find_packages
setup(
name="Coinbox-mod-currency",
version="0.2",
packages=find_packages(),
zip_safe=True,
namespace_packages=['cbmod'],
include_package_data=True,
install_requires=[
'sqlalchemy>=0.7, <1.0',
'... | [
"setuptools.find_packages"
] | [((123, 138), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (136, 138), False, 'from setuptools import setup, find_packages\n')] |
"""
Support for valgrind: tell it when we patch code in-place.
"""
from rpython.rtyper.tool import rffi_platform
from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
from rpython.translator.tool.cbuild import ExternalCompilationInfo
from rpython.rlib.objectmodel import we_are_translated
from rpython.jit.back... | [
"rpython.rtyper.lltypesystem.rffi.llexternal",
"rpython.rtyper.tool.rffi_platform.verify_eci",
"rpython.translator.tool.cbuild.ExternalCompilationInfo",
"rpython.rtyper.lltypesystem.llmemory.cast_int_to_adr",
"rpython.rlib.objectmodel.we_are_translated"
] | [((353, 410), 'rpython.translator.tool.cbuild.ExternalCompilationInfo', 'ExternalCompilationInfo', ([], {'includes': "['valgrind/valgrind.h']"}), "(includes=['valgrind/valgrind.h'])\n", (376, 410), False, 'from rpython.translator.tool.cbuild import ExternalCompilationInfo\n'), ((5195, 5357), 'rpython.rtyper.lltypesyste... |
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class DynamicUpsamplingFilter(nn.Module):
"""Dynamic upsampling filter used in DUF.
Ref: https://github.com/yhjo09/VSR-DUF.
It only supports input with 3 channels. And it ... | [
"torch.matmul",
"numpy.prod"
] | [((1033, 1053), 'numpy.prod', 'np.prod', (['filter_size'], {}), '(filter_size)\n', (1040, 1053), True, 'import numpy as np\n'), ((2518, 2555), 'torch.matmul', 'torch.matmul', (['expanded_input', 'filters'], {}), '(expanded_input, filters)\n', (2530, 2555), False, 'import torch\n')] |
"""Utils scripts for GraphDTA."""
import os
import numpy as np
from math import sqrt
from scipy import stats
from torch_geometric.data import InMemoryDataset, DataLoader
from torch_geometric import data as DATA
import torch
class TestbedDataset(InMemoryDataset):
"""TestbedDataset."""
def __init__(self, root=... | [
"os.makedirs",
"torch.LongTensor",
"numpy.corrcoef",
"torch.load",
"scipy.stats.spearmanr",
"os.path.exists",
"torch.FloatTensor",
"numpy.argsort",
"os.path.isfile",
"torch.Tensor"
] | [((3432, 3445), 'numpy.argsort', 'np.argsort', (['y'], {}), '(y)\n', (3442, 3445), True, 'import numpy as np\n'), ((651, 690), 'os.path.isfile', 'os.path.isfile', (['self.processed_paths[0]'], {}), '(self.processed_paths[0])\n', (665, 690), False, 'import os\n'), ((3269, 3286), 'numpy.corrcoef', 'np.corrcoef', (['y', '... |
import datetime
import json
from pathlib import Path
from unittest import mock
import pytest
import responses
from confluent_kafka import Consumer
from hydraulics.ifcb import image_ingestor
class TestZippedBin:
fname = 'D20190728T212639_IFCB104.zip'
zip_path = Path(__file__).parent / 'data' / fname
test... | [
"hydraulics.ifcb.image_ingestor.IFCBImageIngestor",
"responses.add",
"confluent_kafka.Consumer",
"datetime.datetime",
"unittest.mock.patch",
"hydraulics.ifcb.image_ingestor.IFCBZippedBin",
"pathlib.Path"
] | [((1705, 1743), 'hydraulics.ifcb.image_ingestor.IFCBZippedBin', 'image_ingestor.IFCBZippedBin', (['zip_path'], {}), '(zip_path)\n', (1733, 1743), False, 'from hydraulics.ifcb import image_ingestor\n'), ((2411, 2484), 'unittest.mock.patch', 'mock.patch', (['"""hydraulics.ifcb.image_ingestor.IFCBZippedBin"""'], {'autospe... |
import sys
import time
import bs4
import keyring
import requests
from .constants import *
def submit(args):
contest, problem_letter = translate_problem_name(args.problem)
with requests.Session() as s:
site = s.get('https://codeforces.com/enter')
soup = bs4.BeautifulSoup(site.content, 'html.... | [
"requests.Session",
"time.sleep",
"keyring.get_password",
"bs4.BeautifulSoup",
"sys.exit"
] | [((189, 207), 'requests.Session', 'requests.Session', ([], {}), '()\n', (205, 207), False, 'import requests\n'), ((282, 328), 'bs4.BeautifulSoup', 'bs4.BeautifulSoup', (['site.content', '"""html.parser"""'], {}), "(site.content, 'html.parser')\n", (299, 328), False, 'import bs4\n'), ((455, 499), 'keyring.get_password',... |
import copy
import logging
import os
import pathlib
import time
from collections import defaultdict
from datetime import datetime
import opendssdirect as dss
import pandas as pd
import opendssdirect as dss
from PyDSS.pyLogger import getLoggerTag
from PyDSS.unitDefinations import unit_info
from PyDSS.common import (
... | [
"PyDSS.utils.dataframe_utils.write_dataframe",
"os.remove",
"opendssdirect.CktElement.CurrentsMagAng",
"PyDSS.exceptions.InvalidParameter",
"PyDSS.dataset_buffer.DatasetBuffer",
"pathlib.Path",
"PyDSS.utils.dss_utils.get_node_names_by_type",
"opendssdirect.PVsystems.Count",
"opendssdirect.CktElement... | [((1240, 1267), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1257, 1267), False, 'import logging\n'), ((2745, 2820), 'os.path.join', 'os.path.join', (["self.system_paths['Export']", 'settings.project.active_scenario'], {}), "(self.system_paths['Export'], settings.project.active_scenari... |
import torch
from transformers import RobertaTokenizer, RobertaModel, RobertaForMaskedLM, RobertaConfig
def make_vocab(vocab_file):
"""Convert a file of newline separated words into a Python list and return it."""
vocab = []
with open(vocab_file, 'r') as v:
vocab = v.read().splitlines()
return... | [
"torch.squeeze",
"torch.no_grad",
"torch.stack",
"torch.tensor"
] | [((1670, 1685), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (1683, 1685), False, 'import torch\n'), ((1813, 1847), 'torch.stack', 'torch.stack', (['encoded_layers'], {'dim': '(0)'}), '(encoded_layers, dim=0)\n', (1824, 1847), False, 'import torch\n'), ((1918, 1956), 'torch.squeeze', 'torch.squeeze', (['token_em... |
"""
Copyright 2020 The OneFlow 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 applicable law or agr... | [
"oneflow.framework.docstr.utils.add_docstr"
] | [((660, 6844), 'oneflow.framework.docstr.utils.add_docstr', 'add_docstr', (['oneflow.tensordot', '"""\n tensordot(a, b, dims=Union[int, Tensor, Tuple[List[int], List[int]], List[List[int]]], out=None) -> Tensor\n \n Compute tensor dot along given dimensions.\n \n Given two tensors a and b, and dims which... |
"""EditorConfig Python Core"""
from editorconfig.versiontools import join_version
VERSION = (0, 11, 1, "final")
__all__ = ['get_properties', 'EditorConfigError', 'exceptions']
__version__ = join_version(VERSION)
def get_properties(filename):
"""Locate and parse EditorConfig files for the given filename"""
... | [
"editorconfig.handler.EditorConfigHandler",
"editorconfig.versiontools.join_version"
] | [((194, 215), 'editorconfig.versiontools.join_version', 'join_version', (['VERSION'], {}), '(VERSION)\n', (206, 215), False, 'from editorconfig.versiontools import join_version\n'), ((331, 360), 'editorconfig.handler.EditorConfigHandler', 'EditorConfigHandler', (['filename'], {}), '(filename)\n', (350, 360), False, 'fr... |
from typing import List, Optional, Union
import numpy as np
from zquantum.core.circuit import Circuit
from zquantum.core.circuit import (
add_ancilla_register_to_circuit as _add_ancilla_register_to_circuit,
)
from zquantum.core.circuit import (
build_circuit_layers_and_connectivity as _build_circuit_layers_and... | [
"zquantum.core.circuit.build_uniform_param_grid",
"zquantum.core.testing.create_random_circuit",
"zquantum.core.utils.create_symbols_map",
"numpy.random.seed",
"zquantum.core.utils.load_from_specs",
"zquantum.core.circuit.combine_ansatz_params",
"zquantum.core.circuit.add_ancilla_register_to_circuit",
... | [((1514, 1575), 'numpy.random.uniform', 'np.random.uniform', (['min_value', 'max_value', 'number_of_parameters'], {}), '(min_value, max_value, number_of_parameters)\n', (1531, 1575), True, 'import numpy as np\n'), ((1580, 1631), 'zquantum.core.circuit.save_circuit_template_params', 'save_circuit_template_params', (['pa... |
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: testDbClient
Description :
Author : JHao
date: 2020/6/23
-------------------------------------------------
Change Activity:
2020/6/23:
------------------------------------------... | [
"db.dbClient.DbClient.parseDbConn"
] | [((509, 539), 'db.dbClient.DbClient.parseDbConn', 'DbClient.parseDbConn', (['ssdb_uri'], {}), '(ssdb_uri)\n', (529, 539), False, 'from db.dbClient import DbClient\n'), ((777, 808), 'db.dbClient.DbClient.parseDbConn', 'DbClient.parseDbConn', (['redis_uri'], {}), '(redis_uri)\n', (797, 808), False, 'from db.dbClient impo... |
import scrapy
from demo.items import DemoItem
from scrapy.loader import ItemLoader
class titleSpider(scrapy.Spider):
"""docstring for titleSpider."""
name = 'spiderName'
# start_urls = []
# f = open("D:\CourseAutomation\scrapy\edx.txt", 'r')
# for urls in f.readlines():
# start_urls.append(... | [
"demo.items.DemoItem"
] | [((546, 556), 'demo.items.DemoItem', 'DemoItem', ([], {}), '()\n', (554, 556), False, 'from demo.items import DemoItem\n')] |
"""
RFB protocol implementattion, client side.
Override RFBClient and RFBFactory in your application.
See vncviewer.py for an example.
Reference:
http://www.realvnc.com/docs/rfbproto.pdf
(C) 2003 <EMAIL>
MIT License
"""
import sys
from struct import pack, unpack
#import pyDes
import logging
import asyncio
# encod... | [
"logging.debug",
"logging.basicConfig",
"logging.warning",
"struct.unpack",
"struct.pack",
"asyncio.get_running_loop",
"logging.info"
] | [((19446, 19472), 'asyncio.get_running_loop', 'asyncio.get_running_loop', ([], {}), '()\n', (19470, 19472), False, 'import asyncio\n'), ((19835, 19875), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (19854, 19875), False, 'import logging\n'), ((2965, 2984), '... |
# coding=utf-8
# Copyright (c) 2015 EMC Corporation.
# 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
#
#... | [
"hamcrest.equal_to",
"storops.vnx.resource.lun.VNXLun",
"hamcrest.instance_of",
"hamcrest.only_contains",
"hamcrest.close_to",
"hamcrest.not_none",
"hamcrest.has_item",
"hamcrest.contains_string",
"storops_test.vnx.cli_mock.t_cli",
"storops.vnx.resource.lun.VNXLun.get_id",
"hamcrest.raises",
"... | [((1925, 1932), 'storops_test.vnx.cli_mock.t_cli', 't_cli', ([], {}), '()\n', (1930, 1932), False, 'from storops_test.vnx.cli_mock import t_cli, patch_cli\n'), ((7564, 7572), 'storops.vnx.resource.lun.VNXLun', 'VNXLun', ([], {}), '()\n', (7570, 7572), False, 'from storops.vnx.resource.lun import VNXLun, VNXLunList\n'),... |
import time
import sys
import subprocess
time_avg = 0
times = int(sys.argv[1])
command = sys.argv[2]
command_list = ["python3"]
for c in command.split():
command_list.append(c)
for t in range(times):
start = time.time()
subprocess.call(command_list)
end = time.time()
time_avg += (end-start)
prin... | [
"subprocess.call",
"time.time"
] | [((219, 230), 'time.time', 'time.time', ([], {}), '()\n', (228, 230), False, 'import time\n'), ((235, 264), 'subprocess.call', 'subprocess.call', (['command_list'], {}), '(command_list)\n', (250, 264), False, 'import subprocess\n'), ((275, 286), 'time.time', 'time.time', ([], {}), '()\n', (284, 286), False, 'import tim... |
#!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individual... | [
"voodoo.gen.load_dir",
"unittest.makeSuite",
"voodoo.gen.registry.GLOBAL_REGISTRY.clear"
] | [((564, 587), 'voodoo.gen.registry.GLOBAL_REGISTRY.clear', 'GLOBAL_REGISTRY.clear', ([], {}), '()\n', (585, 587), False, 'from voodoo.gen.registry import GLOBAL_REGISTRY\n'), ((964, 1008), 'voodoo.gen.load_dir', 'load_dir', (['"""test/deployments/webclient_dummy"""'], {}), "('test/deployments/webclient_dummy')\n", (972... |
# To run all test in a Python environment:
import sys; sys.path.insert(0, "C:\Work\python\mikecore"); import tests.test_run_all
| [
"sys.path.insert"
] | [((55, 103), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""C:\\\\Work\\\\python\\\\mikecore"""'], {}), "(0, 'C:\\\\Work\\\\python\\\\mikecore')\n", (70, 103), False, 'import sys\n')] |
import attr
from pygments.lexers.jvm import JavaLexer
from typing import List
from httprider.core.core_settings import app_settings
from httprider.exporters.common import *
from httprider.model.app_data import (
ApiCall,
HttpExchange,
ApiTestCase,
AssertionDataSource,
)
from httprider.codegen.schema_to... | [
"httprider.codegen.schema_to_java_generator.to_java_function_name",
"httprider.core.core_settings.app_settings.app_data_cache.get_last_exchange",
"pygments.lexers.jvm.JavaLexer",
"httprider.core.core_settings.app_settings.app_data_cache.get_api_test_case"
] | [((3771, 3829), 'httprider.core.core_settings.app_settings.app_data_cache.get_last_exchange', 'app_settings.app_data_cache.get_last_exchange', (['api_call.id'], {}), '(api_call.id)\n', (3816, 3829), False, 'from httprider.core.core_settings import app_settings\n'), ((3854, 3912), 'httprider.core.core_settings.app_setti... |
import nibabel as nib
import numpy as np
from training.generator_coords import CoordsGenerator
import torch
class Predictor:
"""Only useful for serving... other methods would use a dataloader"""
def __init__(
self, model, volume_shape, subvolume_shape, n_subvolumes, n_classes
):
"""Docs.... | [
"nibabel.load",
"training.generator_coords.CoordsGenerator",
"numpy.zeros",
"numpy.expand_dims",
"numpy.insert",
"torch.cuda.is_available",
"torch.max",
"torch.device",
"torch.no_grad"
] | [((541, 597), 'training.generator_coords.CoordsGenerator', 'CoordsGenerator', (['self.volume_shape', 'self.subvolume_shape'], {}), '(self.volume_shape, self.subvolume_shape)\n', (556, 597), False, 'from training.generator_coords import CoordsGenerator\n'), ((1000, 1025), 'torch.device', 'torch.device', (['device_name']... |
from munxs.tree import NeXusTree
class muisis2py(NeXusTree): # defines the python class
def get_numberHisto_int(self):
"""
usage::
from muisis2py import muisis2py as muld
path2file = 'path and filename'
run = muld(path2file,'r') # this is the run data nexus file
... | [
"numpy.set_printoptions"
] | [((8313, 8345), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(3)'}), '(precision=3)\n', (8332, 8345), True, 'import numpy as np\n')] |
# Process Monitor Daemon Class
# Given a Set of Targets and a Callback, Monitor Processes for Create and Perform Callback
from threading import Thread
from ProcessMonitor.pywinapi.psapi import enum_processes
from ProcessMonitor.ProcessInfo import ProcessInfo
class ProcessMonitor(object):
def __init__(self, target... | [
"threading.Thread",
"ProcessMonitor.pywinapi.psapi.enum_processes",
"ProcessMonitor.ProcessInfo.ProcessInfo"
] | [((848, 875), 'threading.Thread', 'Thread', ([], {'target': 'self.monitor'}), '(target=self.monitor)\n', (854, 875), False, 'from threading import Thread\n'), ((1736, 1752), 'ProcessMonitor.pywinapi.psapi.enum_processes', 'enum_processes', ([], {}), '()\n', (1750, 1752), False, 'from ProcessMonitor.pywinapi.psapi impor... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Code released in the Public Domain. You can do whatever you want with this package.
# Originally written by <NAME> <<EMAIL>> for the OLPC XO laptop.
from gettext import gettext
# pgettext(msgctxt, msgid) from gettext is not supported in Python implementation < v2.6.... | [
"gettext.gettext"
] | [((929, 976), 'gettext.gettext', 'gettext', (['(msgctxt + GETTEXT_CONTEXT_GLUE + msgid)'], {}), '(msgctxt + GETTEXT_CONTEXT_GLUE + msgid)\n', (936, 976), False, 'from gettext import gettext\n'), ((1139, 1153), 'gettext.gettext', 'gettext', (['msgid'], {}), '(msgid)\n', (1146, 1153), False, 'from gettext import gettext\... |
# This is a fun problem that uses the turtle module.
# If you’ve never used the turtle module, the first two
# lines below are how to set it up and lines after are basic instructions:
# import turtle
# bob = turtle.Turtle() #doesn’t have to be bob
# bob.left(angle) #turns bob left to an angle like 90
# bob.right(angle... | [
"turtle.Turtle"
] | [((1070, 1085), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (1083, 1085), False, 'import turtle\n')] |
from textwrap import dedent
from rest_framework.schemas.openapi import AutoSchema
from ._message import message_schema
from ._message import message_with_id_schema
from ._errors import error_responses
from .components.dashboard import dashboard_fields as fields
boilerplate = dedent("""\
Dashboards are customized in... | [
"textwrap.dedent"
] | [((280, 396), 'textwrap.dedent', 'dedent', (['"""Dashboards are customized interfaces (i.e. html files) displayed within the Tator projects.\n"""'], {}), '(\n """Dashboards are customized interfaces (i.e. html files) displayed within the Tator projects.\n"""\n )\n', (286, 396), False, 'from textwrap import dedent... |
from webcrawler.lenses.crawledlens import CrawledLens
from webcrawler.persistency.mongoaccess import MongoAccess
from webcrawler.lenses import datakeys
#Data looks like:
# {lensname: CrawledLens, lensname2: CrawledLens2, ...}
class CrawledLenses:
def __init__(self, db_name, collection_name):
self.mo... | [
"webcrawler.persistency.mongoaccess.MongoAccess",
"webcrawler.lenses.crawledlens.CrawledLens"
] | [((333, 346), 'webcrawler.persistency.mongoaccess.MongoAccess', 'MongoAccess', ([], {}), '()\n', (344, 346), False, 'from webcrawler.persistency.mongoaccess import MongoAccess\n'), ((1181, 1203), 'webcrawler.lenses.crawledlens.CrawledLens', 'CrawledLens', (['lens_dict'], {}), '(lens_dict)\n', (1192, 1203), False, 'from... |
from flask import Flask, render_template
from flask_frozen import Freezer
from flask_flatpages import FlatPages
import sys
DEBUG = False
FREEZER_DESTINATION = "docs"
FREEZER_DESTINATION_IGNORE = ["CNAME","404.html"]
FLATPAGES_AUTO_RELOAD = DEBUG
FLATPAGES_EXTENSION = ['.html', '.md']
FLATPAGES_ROOT = 'content'
CORP_PO... | [
"flask_frozen.Freezer",
"flask.Flask",
"flask_flatpages.FlatPages",
"flask.render_template"
] | [((348, 363), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (353, 363), False, 'from flask import Flask, render_template\n'), ((405, 419), 'flask_flatpages.FlatPages', 'FlatPages', (['app'], {}), '(app)\n', (414, 419), False, 'from flask_flatpages import FlatPages\n'), ((430, 442), 'flask_frozen.Freezer',... |
import os, sys, json, requests, random, time
from threading import Thread
from Crypto.Hash import SHA256
from Crypto.PublicKey import RSA
from Crypto.Signature import pkcs1_15
sys.setrecursionlimit(500000)
from flask import Flask, request
app = Flask(__name__)
# import logging
# log = logging.getLogger('werkzeug')... | [
"threading.Thread",
"json.loads",
"Crypto.PublicKey.RSA.import_key",
"flask.Flask",
"json.dumps",
"random.random",
"flask.request.get_data",
"requests.get",
"Crypto.PublicKey.RSA.importKey",
"sys.setrecursionlimit"
] | [((179, 208), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(500000)'], {}), '(500000)\n', (200, 208), False, 'import os, sys, json, requests, random, time\n'), ((249, 264), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (254, 264), False, 'from flask import Flask, request\n'), ((1295, 1319), 'json.... |
# Generated by Django 3.2 on 2021-09-28 09:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("data_finder", "0013_increase_referer_field_length"),
]
operations = [
migrations.AlterField(
model_name="loggedpostcode",
... | [
"django.db.models.BooleanField"
] | [((363, 393), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'null': '(True)'}), '(null=True)\n', (382, 393), False, 'from django.db import migrations, models\n')] |
#!/usr/bin/env python
# python -m pip install pika
import pika
node = "192.168.0.30"
user = "admin1"
pwd = "<PASSWORD>"
# Connect to a remote AMQP server with a username/password
credentials = pika.PlainCredentials(user, pwd)
connection = pika.BlockingConnection(pika.ConnectionParameters(node,
5672, '/', cred... | [
"pika.BasicProperties",
"pika.PlainCredentials",
"pika.ConnectionParameters"
] | [((195, 227), 'pika.PlainCredentials', 'pika.PlainCredentials', (['user', 'pwd'], {}), '(user, pwd)\n', (216, 227), False, 'import pika\n'), ((549, 642), 'pika.BasicProperties', 'pika.BasicProperties', ([], {'headers': "{'status': 'Good Quality', 'alarm': 'HI'}", 'type': '"""Pi Sensor"""'}), "(headers={'status': 'Good ... |
from django import template
register = template.Library()
@register.filter
def restar(num, val):
return num - val
| [
"django.template.Library"
] | [((40, 58), 'django.template.Library', 'template.Library', ([], {}), '()\n', (56, 58), False, 'from django import template\n')] |
from flask import Flask, request
from mov_rec import app, database
from mov_rec.view_function_response import ViewFunctionResponse
@app.route("/view_movie", methods=['GET'])
def view_movie(): # wrapper for view function, to allow for testing
view_response = view_movie_response(request)
return view_response.g... | [
"mov_rec.view_function_response.ViewFunctionResponse",
"mov_rec.database.movie_info",
"mov_rec.app.route",
"flask.request.args.get"
] | [((134, 175), 'mov_rec.app.route', 'app.route', (['"""/view_movie"""'], {'methods': "['GET']"}), "('/view_movie', methods=['GET'])\n", (143, 175), False, 'from mov_rec import app, database\n'), ((395, 417), 'mov_rec.view_function_response.ViewFunctionResponse', 'ViewFunctionResponse', ([], {}), '()\n', (415, 417), Fals... |
"""
Classes for sequence features
"""
import operator
import sys
import grimoire.toolbox as toolbox
class FeatureError(Exception):
pass
class Feature:
"""Class representing a sequence feature, which may have children."""
def __init__(self, dna, beg, end, strand, type,
phase='.', score='.', source='.', id=Non... | [
"operator.attrgetter",
"grimoire.toolbox.longest_orf",
"grimoire.toolbox.translate_str",
"grimoire.toolbox.revcomp_str"
] | [((10482, 10508), 'grimoire.toolbox.translate_str', 'toolbox.translate_str', (['cds'], {}), '(cds)\n', (10503, 10508), True, 'import grimoire.toolbox as toolbox\n'), ((10921, 10945), 'grimoire.toolbox.longest_orf', 'toolbox.longest_orf', (['rna'], {}), '(rna)\n', (10940, 10945), True, 'import grimoire.toolbox as toolbo... |
import datetime
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import render
from django.views.generic import ListView
from projects.models import Project
from python_recipes import get_week_of_month_from_datetime, \
get_week_start_datetime_end_datetime_tuple
from tracking.models i... | [
"datetime.datetime.today",
"python_recipes.get_week_of_month_from_datetime",
"datetime.timedelta",
"python_recipes.get_week_start_datetime_end_datetime_tuple",
"projects.models.Project.objects.filter"
] | [((607, 645), 'python_recipes.get_week_of_month_from_datetime', 'get_week_of_month_from_datetime', (['today'], {}), '(today)\n', (638, 645), False, 'from python_recipes import get_week_of_month_from_datetime, get_week_start_datetime_end_datetime_tuple\n'), ((561, 586), 'datetime.datetime.today', 'datetime.datetime.toda... |
import ancestries
def test_list_of_ancestries():
assert ancestries.list_of_ancestries == ['Dwarf', 'Elf']
def test_get_boost():
assert ancestries.get_boosts('Dwarf') == ['Constitution', 'Wisdom']
assert ancestries.get_boosts('Elf') == ['Dexterity', 'Intelligence']
def test_get_flaw():
assert ancestr... | [
"ancestries.get_boosts",
"ancestries.get_flaw"
] | [((145, 175), 'ancestries.get_boosts', 'ancestries.get_boosts', (['"""Dwarf"""'], {}), "('Dwarf')\n", (166, 175), False, 'import ancestries\n'), ((217, 245), 'ancestries.get_boosts', 'ancestries.get_boosts', (['"""Elf"""'], {}), "('Elf')\n", (238, 245), False, 'import ancestries\n'), ((313, 344), 'ancestries.get_flaw',... |
# Generated by Django 2.1 on 2018-08-26 00:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('model_filefields_example', '0002_auto_20180826_0054'),
]
operations = [
migrations.AlterField(
model_name='bookcover',
... | [
"django.db.models.BinaryField"
] | [((353, 373), 'django.db.models.BinaryField', 'models.BinaryField', ([], {}), '()\n', (371, 373), False, 'from django.db import migrations, models\n')] |
import six
import typing
from inspect import signature
from descarteslabs.common.graft import client
from ...cereal import serializable
from ..core import Proxytype, GenericProxytype, ProxyTypeError, assert_is_proxytype
from ..primitives import Any
from ..identifier import identifier
from ..proxify import proxify
... | [
"descarteslabs.common.graft.client.guid",
"six.viewkeys",
"typing.get_type_hints",
"inspect.signature",
"six.iteritems"
] | [((14990, 15005), 'inspect.signature', 'signature', (['func'], {}), '(func)\n', (14999, 15005), False, 'from inspect import signature\n'), ((15018, 15045), 'typing.get_type_hints', 'typing.get_type_hints', (['func'], {}), '(func)\n', (15039, 15045), False, 'import typing\n'), ((6287, 6314), 'six.iteritems', 'six.iterit... |
from drf_yasg.utils import swagger_auto_schema
from rest_framework import viewsets, status
from rest_framework.decorators import action
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from cvat.apps.engine.models import Project
from cvat.apps.training.jobs import sav... | [
"drf_yasg.utils.swagger_auto_schema",
"cvat.apps.training.jobs.save_frame_prediction_to_cache_job.delay",
"rest_framework.response.Response",
"rest_framework.decorators.action",
"cvat.apps.engine.models.Project.objects.get",
"cvat.apps.training.jobs.save_prediction_server_status_to_cache_job.delay"
] | [((561, 649), 'drf_yasg.utils.swagger_auto_schema', 'swagger_auto_schema', ([], {'method': '"""get"""', 'operation_summary': '"""Returns prediction for image"""'}), "(method='get', operation_summary=\n 'Returns prediction for image')\n", (580, 649), False, 'from drf_yasg.utils import swagger_auto_schema\n'), ((650, ... |
import argparse
import pandas as pd
import PyFloraBook.in_out.data_coordinator as dc
from PyFloraBook.threshold.partition import find_best_partitioning
# ---------------- GLOBALS ----------------
INPUT_SUFFIX = "scores"
OUTPUT_SUFFIX = "partitions"
# ---------------- INPUT ----------------
# Parse arguments
parser ... | [
"pandas.DataFrame",
"argparse.ArgumentParser",
"PyFloraBook.in_out.data_coordinator.locate_selections_folder",
"PyFloraBook.in_out.data_coordinator.locate_scores_folder",
"PyFloraBook.threshold.partition.find_best_partitioning"
] | [((322, 473), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Determine the optimal distribution of pages for each genus and species (for my plant drawing project)."""'}), "(description=\n 'Determine the optimal distribution of pages for each genus and species (for my plant drawing pro... |
"""
*What is this pattern about?
The Borg pattern (also known as the Monostate pattern) is a way to
implement singleton behavior, but instead of having only one instance
of a class, there are multiple instances that share the same state. In
other words, the focus is on sharing state instead of sharing instance
identity... | [
"doctest.testmod"
] | [((3197, 3214), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (3212, 3214), False, 'import doctest\n')] |
# Copyright (c) 2020, Xilinx
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the follow... | [
"finn.custom_op.registry.getCustomOp",
"finn.transformation.fpgadataflow.insert_fifo.InsertFIFO",
"numpy.load",
"finn.transformation.fpgadataflow.create_stitched_ip.CreateStitchedIP",
"numpy.argmax",
"finn.transformation.double_to_single_float.DoubleToSingleFloat",
"finn.transformation.fpgadataflow.conv... | [((4161, 4203), 'os.getenv', 'os.getenv', (['"""PYNQ_BOARD"""'], {'default': '"""Pynq-Z1"""'}), "('PYNQ_BOARD', default='Pynq-Z1')\n", (4170, 4203), False, 'import os\n'), ((4374, 4409), 'finn.util.test.get_test_model_trained', 'get_test_model_trained', (['"""CNV"""', '(1)', '(1)'], {}), "('CNV', 1, 1)\n", (4396, 4409)... |
import toga
PARENT_GROUP1 = toga.Group("P", 1)
CHILD_GROUP1 = toga.Group("C", order=2, parent=PARENT_GROUP1)
CHILD_GROUP2 = toga.Group("B", order=4, parent=PARENT_GROUP1)
PARENT_GROUP2 = toga.Group("O", 2)
CHILD_GROUP3 = toga.Group("A", 2, parent=PARENT_GROUP2)
A = toga.Command(None, "A", group=PARENT_GROUP2, order=1... | [
"toga.Command",
"toga.Group"
] | [((29, 47), 'toga.Group', 'toga.Group', (['"""P"""', '(1)'], {}), "('P', 1)\n", (39, 47), False, 'import toga\n'), ((63, 109), 'toga.Group', 'toga.Group', (['"""C"""'], {'order': '(2)', 'parent': 'PARENT_GROUP1'}), "('C', order=2, parent=PARENT_GROUP1)\n", (73, 109), False, 'import toga\n'), ((125, 171), 'toga.Group', ... |
import tensorflow as tf
import numpy as np
import time
from PIL import Image
import matplotlib.pyplot as plt
from skimage import filters, transform
from setup_cifar import CIFAR, CIFARModel
from setup_inception import ImageNet, InceptionModel
from l2_attack import CarliniL2
from l0_attack import CarliniL0
from li_att... | [
"numpy.load",
"setup_cifar.CIFARModel",
"matplotlib.pyplot.show",
"numpy.random.seed",
"numpy.argmax",
"tensorflow.Session",
"setup_cifar.CIFAR",
"skimage.transform.AffineTransform",
"matplotlib.pyplot.figure",
"numpy.array",
"skimage.transform.warp",
"matplotlib.pyplot.subplots_adjust",
"nu... | [((1763, 1779), 'numpy.array', 'np.array', (['inputs'], {}), '(inputs)\n', (1771, 1779), True, 'import numpy as np\n'), ((1794, 1811), 'numpy.array', 'np.array', (['targets'], {}), '(targets)\n', (1802, 1811), True, 'import numpy as np\n'), ((2938, 2950), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (294... |
"""
Serviços para gerar o endpoint da aplicação
"""
import service.check_system as check_system
def services(req):
"""
Nome:
Services
Descrição:
Função de requisição dos endpoints
:Args: requisição flask
:Retorna: endpoints com determinado valor pedido na requisição
"""
... | [
"service.check_system.check_system"
] | [((376, 406), 'service.check_system.check_system', 'check_system.check_system', (['req'], {}), '(req)\n', (401, 406), True, 'import service.check_system as check_system\n')] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.