prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>""" core/api/serializers.py is the module for core model api data serializers """ #import core django module from django.contrib.auth.models import User, Permission #import external modules from rest_framework import serializers #import project modules fro...
""" REST API serializer for ProductPresentation model """ class Meta: model = ProductPresentation
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>""" core/api/serializers.py is the module for core model api data serializers """ #import core django module from django.contrib.auth.models import User, Permission #import external modules from rest_framework import serializers #import project modules fro...
model = ProductPresentation
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>""" core/api/serializers.py is the module for core model api data serializers """ #import core django module from django.contrib.auth.models import User, Permission #import external modules from rest_framework import serializers #import project modules fro...
""" REST API serializer for ModeOfAdministration model """ class Meta: model = ModeOfAdministration
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>""" core/api/serializers.py is the module for core model api data serializers """ #import core django module from django.contrib.auth.models import User, Permission #import external modules from rest_framework import serializers #import project modules fro...
model = ModeOfAdministration
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>""" core/api/serializers.py is the module for core model api data serializers """ #import core django module from django.contrib.auth.models import User, Permission #import external modules from rest_framework import serializers #import project modules fro...
""" REST API serializer for ProductItem model """ class Meta: model = ProductItem
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>""" core/api/serializers.py is the module for core model api data serializers """ #import core django module from django.contrib.auth.models import User, Permission #import external modules from rest_framework import serializers #import project modules fro...
model = ProductItem
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>""" core/api/serializers.py is the module for core model api data serializers """ #import core django module from django.contrib.auth.models import User, Permission #import external modules from rest_framework import serializers #import project modules fro...
""" REST API serializer for ProductFormulation model, it can be Lyophilized, Liquid or Not Applicable """ class Meta: model = ProductFormulation
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>""" core/api/serializers.py is the module for core model api data serializers """ #import core django module from django.contrib.auth.models import User, Permission #import external modules from rest_framework import serializers #import project modules fro...
model = ProductFormulation
<|file_name|>testimony_markers.py<|end_file_name|><|fim▁begin|>import inspect import re import pytest from robottelo.logging import collection_logger as logger IMPORTANCE_LEVELS = [] def pytest_addoption(parser): """Add CLI options related to Testimony token based mark collection""" parser.addoption( ...
# Unit test, no testimony markers continue
<|file_name|>testimony_markers.py<|end_file_name|><|fim▁begin|>import inspect import re import pytest from robottelo.logging import collection_logger as logger IMPORTANCE_LEVELS = [] def pytest_addoption(parser): <|fim_middle|> def pytest_configure(config): """Register markers related to testimony token...
"""Add CLI options related to Testimony token based mark collection""" parser.addoption( '--importance', help='Comma separated list of importance levels to include in test collection', ) parser.addoption( '--component', help='Comma separated list of component names to inc...
<|file_name|>testimony_markers.py<|end_file_name|><|fim▁begin|>import inspect import re import pytest from robottelo.logging import collection_logger as logger IMPORTANCE_LEVELS = [] def pytest_addoption(parser): """Add CLI options related to Testimony token based mark collection""" parser.addoption( ...
"""Register markers related to testimony tokens""" for marker in [ 'importance: CaseImportance testimony token, use --importance to filter', 'component: Component testimony token, use --component to filter', 'assignee: Assignee testimony token, use --assignee to filter', ]: c...
<|file_name|>testimony_markers.py<|end_file_name|><|fim▁begin|>import inspect import re import pytest from robottelo.logging import collection_logger as logger IMPORTANCE_LEVELS = [] def pytest_addoption(parser): """Add CLI options related to Testimony token based mark collection""" parser.addoption( ...
"""Add markers for testimony tokens""" # split the option string and handle no option, single option, multiple # config.getoption(default) doesn't work like you think it does, hence or '' importance = [i for i in (config.getoption('importance') or '').split(',') if i != ''] component = [c for c in (...
<|file_name|>testimony_markers.py<|end_file_name|><|fim▁begin|>import inspect import re import pytest from robottelo.logging import collection_logger as logger IMPORTANCE_LEVELS = [] def pytest_addoption(parser): """Add CLI options related to Testimony token based mark collection""" parser.addoption( ...
continue
<|file_name|>testimony_markers.py<|end_file_name|><|fim▁begin|>import inspect import re import pytest from robottelo.logging import collection_logger as logger IMPORTANCE_LEVELS = [] def pytest_addoption(parser): """Add CLI options related to Testimony token based mark collection""" parser.addoption( ...
item.add_marker(pytest.mark.component(doc_component[0]))
<|file_name|>testimony_markers.py<|end_file_name|><|fim▁begin|>import inspect import re import pytest from robottelo.logging import collection_logger as logger IMPORTANCE_LEVELS = [] def pytest_addoption(parser): """Add CLI options related to Testimony token based mark collection""" parser.addoption( ...
item.add_marker(pytest.mark.importance(doc_importance[0]))
<|file_name|>testimony_markers.py<|end_file_name|><|fim▁begin|>import inspect import re import pytest from robottelo.logging import collection_logger as logger IMPORTANCE_LEVELS = [] def pytest_addoption(parser): """Add CLI options related to Testimony token based mark collection""" parser.addoption( ...
item.add_marker(pytest.mark.assignee(doc_assignee[0]))
<|file_name|>testimony_markers.py<|end_file_name|><|fim▁begin|>import inspect import re import pytest from robottelo.logging import collection_logger as logger IMPORTANCE_LEVELS = [] def pytest_addoption(parser): """Add CLI options related to Testimony token based mark collection""" parser.addoption( ...
importance_marker = item.get_closest_marker('importance').args[0] if importance and importance_marker not in importance: logger.debug( f'Deselected test {item.nodeid} due to "--importance {importance}",' f'test has importance mark: {importa...
<|file_name|>testimony_markers.py<|end_file_name|><|fim▁begin|>import inspect import re import pytest from robottelo.logging import collection_logger as logger IMPORTANCE_LEVELS = [] def pytest_addoption(parser): """Add CLI options related to Testimony token based mark collection""" parser.addoption( ...
logger.debug( f'Deselected test {item.nodeid} due to "--importance {importance}",' f'test has importance mark: {importance_marker}' ) deselected.append(item) continue
<|file_name|>testimony_markers.py<|end_file_name|><|fim▁begin|>import inspect import re import pytest from robottelo.logging import collection_logger as logger IMPORTANCE_LEVELS = [] def pytest_addoption(parser): """Add CLI options related to Testimony token based mark collection""" parser.addoption( ...
logger.debug( f'Deselected test {item.nodeid} due to "--component {component}",' f'test has component mark: {component_marker}' ) deselected.append(item) continue
<|file_name|>testimony_markers.py<|end_file_name|><|fim▁begin|>import inspect import re import pytest from robottelo.logging import collection_logger as logger IMPORTANCE_LEVELS = [] def pytest_addoption(parser): """Add CLI options related to Testimony token based mark collection""" parser.addoption( ...
logger.debug( f'Deselected test {item.nodeid} due to "--assignee {assignee}",' f'test has assignee mark: {assignee_marker}' ) deselected.append(item) continue
<|file_name|>testimony_markers.py<|end_file_name|><|fim▁begin|>import inspect import re import pytest from robottelo.logging import collection_logger as logger IMPORTANCE_LEVELS = [] def <|fim_middle|>(parser): """Add CLI options related to Testimony token based mark collection""" parser.addoption( ...
pytest_addoption
<|file_name|>testimony_markers.py<|end_file_name|><|fim▁begin|>import inspect import re import pytest from robottelo.logging import collection_logger as logger IMPORTANCE_LEVELS = [] def pytest_addoption(parser): """Add CLI options related to Testimony token based mark collection""" parser.addoption( ...
pytest_configure
<|file_name|>testimony_markers.py<|end_file_name|><|fim▁begin|>import inspect import re import pytest from robottelo.logging import collection_logger as logger IMPORTANCE_LEVELS = [] def pytest_addoption(parser): """Add CLI options related to Testimony token based mark collection""" parser.addoption( ...
pytest_collection_modifyitems
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
if self.__resubmit==False: if self.__task.data.get('backend_job_ids') or self.__task.data.get('backend_task_id'): self.__logger.info('This task has already been submitted to backend, rerun the command with "-r" option if you wish to delete current jobs and resubmit the task.')
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): <|fim_middle|> <|fim▁end|>
def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(task_id) self.__sub_ids = sub_ids self.__dry_run = dry_run self.__resubmit = resubmit self.__logger = logging.getLogger('JSUB') if self.__sub_ids==None: s...
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): <|fim_middle|> def __initialize_manager(self): self.__config_m...
self.__manager = manager self.__task = self.__manager.load_task(task_id) self.__sub_ids = sub_ids self.__dry_run = dry_run self.__resubmit = resubmit self.__logger = logging.getLogger('JSUB') if self.__sub_ids==None: self.__sub_ids=range(len(self.__task.data['jobvar'])) self.__initialize_manager()
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
self.__config_mgr = self.__manager.load_config_manager() self.__backend_mgr = self.__manager.load_backend_manager() self.__bootstrap_mgr = self.__manager.load_bootstrap_manager() self.__navigator_mgr = self.__manager.load_navigator_manager() self.__context_mgr = self.__manager.load_context_manager() sel...
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
run_root = self.__backend_mgr.get_run_root(self.__task.data['backend'], self.__task.data['id']) main_root = os.path.join(run_root, 'main') safe_rmdir(main_root) safe_mkdir(main_root) self.__create_input(main_root) self.__create_context(main_root) self.__create_action(main_root) self.__create_navigato...
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
content = self.__manager.load_content() input_dir = os.path.join(main_root,'input') try: content.get(self.__task.data['id'], 'input', os.path.join(main_root, 'input')) except: safe_mkdir(input_dir)
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
context_dir = os.path.join(main_root, 'context') safe_mkdir(context_dir) action_default = {} for unit, param in self.__task.data['workflow'].items(): action_default[unit] = self.__action_mgr.default_config(param['type']) navigators = self.__config_mgr.navigator() context_format = self.__navigator_mgr.c...
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
action_dir = os.path.join(main_root, 'action') safe_mkdir(action_dir) actions = set() for unit, param in self.__task.data['workflow'].items(): actions.add(param['type']) self.__action_mgr.create_actions(actions, action_dir)
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
navigator_dir = os.path.join(main_root, 'navigator') safe_mkdir(navigator_dir) navigators = self.__config_mgr.navigator() self.__navigator_mgr.create_navigators(navigators, navigator_dir)
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
bootstrap_dir = os.path.join(main_root, 'bootstrap') safe_mkdir(bootstrap_dir) bootstrap = self.__config_mgr.bootstrap() self.__bootstrap_mgr.create_bootstrap(bootstrap, bootstrap_dir)
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
launcher = self.__task.data['backend']['launcher'] return self.__launcher_mgr.create_launcher(launcher, run_root)
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
if self.__dry_run: return if self.__resubmit==False: if self.__task.data.get('backend_job_ids') or self.__task.data.get('backend_task_id'): self.__logger.info('This task has already been submitted to backend, rerun the command with "-r" option if you wish to delete current jobs and resubmit the task.') ...
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
self.__sub_ids=range(len(self.__task.data['jobvar']))
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
return
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
if self.__task.data.get('backend_job_ids') or self.__task.data.get('backend_task_id'): self.__logger.info('This task has already been submitted to backend, rerun the command with "-r" option if you wish to delete current jobs and resubmit the task.') return
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
self.__logger.info('This task has already been submitted to backend, rerun the command with "-r" option if you wish to delete current jobs and resubmit the task.') return
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
self.__logger.info('Removing submitted jobs on backend before resubmission.') task_id = self.__task.data.get('backend_task_id') #remove previously generated files in job folder job_ids = self.__task.data.get('backend_job_ids') run_root = self.__backend_mgr.get_run_root(self.__task.data['backend'], self....
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
self.__backend_mgr.delete_task(self.__task.data['backend'],backend_task_id = task_id)
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
self.__backend_mgr.delete_jobs(self.__task.data['backend'],backend_job_ids = job_ids)
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
result = {}
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
njobs = len(result['backend_job_ids'])
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
njobs = len(result)
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
self.__logger.info('%d jobs successfully submitted to backend.'%(njobs))
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def <|fim_middle|>(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_...
__init__
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
__initialize_manager
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
handle
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
__create_input
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
__create_context
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
__create_action
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
__create_navigator
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
__create_bootstrap
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
__create_launcher
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>import os import logging from jsub.util import safe_mkdir from jsub.util import safe_rmdir class Submit(object): def __init__(self, manager, task_id, sub_ids=None, dry_run=False, resubmit=False): self.__manager = manager self.__task = self.__manager.load_task(t...
__submit
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from typing import List, Optional __version__ = "20.0.dev0" def main(args=None): # type: (Optional[List[str]]) -> int """This is an internal API only meant for use by p...
For additional details, see https://github.com/pypa/pip/issues/7498. """
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from typing import List, Optional __version__ = "20.0.dev0" def main(args=None): # type: (Optional[List[str]]) -> int <|fim_middle|> <|fim▁end|>
"""This is an internal API only meant for use by pip's own console scripts. For additional details, see https://github.com/pypa/pip/issues/7498. """ from pip._internal.utils.entrypoints import _wrapper return _wrapper(args)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: <|fim_middle|> __version__ = "20.0.dev0" def main(args=None): # type: (Optional[List[str]]) -> int """This is an internal API only meant for use by pip's own conso...
from typing import List, Optional
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from typing import List, Optional __version__ = "20.0.dev0" def <|fim_middle|>(args=None): # type: (Optional[List[str]]) -> int """This is an internal API only meant fo...
main
<|file_name|>views.py<|end_file_name|><|fim▁begin|>""" Django Views for service status app """ from __future__ import absolute_import import json import time from celery.exceptions import TimeoutError from django.http import HttpResponse from djcelery import celery from openedx.core.djangoapps.service_status.tasks i...
output = { 'success': success, 'task_id': task_id, 'value': value,
<|file_name|>views.py<|end_file_name|><|fim▁begin|>""" Django Views for service status app """ from __future__ import absolute_import import json import time from celery.exceptions import TimeoutError from django.http import HttpResponse from djcelery import celery from openedx.core.djangoapps.service_status.tasks i...
""" An empty view """ return HttpResponse()
<|file_name|>views.py<|end_file_name|><|fim▁begin|>""" Django Views for service status app """ from __future__ import absolute_import import json import time from celery.exceptions import TimeoutError from django.http import HttpResponse from djcelery import celery from openedx.core.djangoapps.service_status.tasks i...
""" A view that returns Celery stats """ stats = celery.control.inspect().stats() or {} return HttpResponse(json.dumps(stats, indent=4), content_type="application/json")
<|file_name|>views.py<|end_file_name|><|fim▁begin|>""" Django Views for service status app """ from __future__ import absolute_import import json import time from celery.exceptions import TimeoutError from django.http import HttpResponse from djcelery import celery from openedx.core.djangoapps.service_status.tasks i...
""" A Simple view that checks if Celery can process a simple task """ start = time.time() result = delayed_ping.apply_async(('ping', 0.1)) task_id = result.id # Wait until we get the result try: value = result.get(timeout=4.0) success = True except TimeoutError: ...
<|file_name|>views.py<|end_file_name|><|fim▁begin|>""" Django Views for service status app """ from __future__ import absolute_import import json import time from celery.exceptions import TimeoutError from django.http import HttpResponse from djcelery import celery from openedx.core.djangoapps.service_status.tasks i...
index
<|file_name|>views.py<|end_file_name|><|fim▁begin|>""" Django Views for service status app """ from __future__ import absolute_import import json import time from celery.exceptions import TimeoutError from django.http import HttpResponse from djcelery import celery from openedx.core.djangoapps.service_status.tasks i...
celery_status
<|file_name|>views.py<|end_file_name|><|fim▁begin|>""" Django Views for service status app """ from __future__ import absolute_import import json import time from celery.exceptions import TimeoutError from django.http import HttpResponse from djcelery import celery from openedx.core.djangoapps.service_status.tasks i...
celery_ping
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
This will fail if a StandardIO has already been instantiated. """ abstract.FileDescriptor.__init__(self) global _stdio_in_use
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
connected = 1 ic = 0 def __init__(self): abstract.FileDescriptor.__init__(self) self.fileno = sys.__stdout__.fileno fdesc.setNonBlocking(self.fileno()) def writeSomeData(self, data): try: return os.write(self.fileno(), data) return rv ...
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
abstract.FileDescriptor.__init__(self) self.fileno = sys.__stdout__.fileno fdesc.setNonBlocking(self.fileno())
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
try: return os.write(self.fileno(), data) return rv except IOError, io: if io.args[0] == errno.EAGAIN: return 0 elif io.args[0] == errno.EPERM: return 0 return CONNECTION_LOST except OSError, ose: ...
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
abstract.FileDescriptor.connectionLost(self, reason) os.close(self.fileno())
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
"""I can connect Standard IO to a twisted.protocol I act as a selectable for sys.stdin, and provide a write method that writes to stdout. """ def __init__(self, protocol): """Create me with a protocol. This will fail if a StandardIO has already been instantiated. """ ...
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
"""Create me with a protocol. This will fail if a StandardIO has already been instantiated. """ abstract.FileDescriptor.__init__(self) global _stdio_in_use if _stdio_in_use: raise RuntimeError, "Standard IO already in use." _stdio_in_use = 1 s...
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
"""Write some data to standard output. """ self.writer.write(data)
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
"""Some data's readable from standard input. """ return fdesc.readFromFD(self.fileno(), self.protocol.dataReceived)
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
"""Close standard input. """ self.writer.loseConnection()
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
"""The connection was lost. """ self.protocol.connectionLost()
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
return 0
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
return 0
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
return CONNECTION_LOST
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
return 0
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
raise RuntimeError, "Standard IO already in use."
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
__init__
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
writeSomeData
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
connectionLost
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
__init__
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
write
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
doRead
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
closeStdin
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Softwar...
connectionLost
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>""" Test suite for the embedded <script> extraction """ from BeautifulSoup import BeautifulSoup from nose.tools import raises, eq_ from csxj.datasources.parser_tools import media_utils from csxj.datasources.parser_tools import twitter_utils from tests.datas...
dewplayer_url = "http://download.saipm.com/flash/dewplayer/dewplayer.swf?mp3=http://podcast.dhnet.be/articles/audio_dh_388635_1331708882.mp3" expected_mp3_url = "http://podcast.dhnet.be/articles/audio_dh_388635_1331708882.mp3" extracted_url = media_utils.extract_source_url_from_dewplayer(dewplay...
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>""" Test suite for the embedded <script> extraction """ from BeautifulSoup import BeautifulSoup from nose.tools import raises, eq_ from csxj.datasources.parser_tools import media_utils from csxj.datasources.parser_tools import twitter_utils from tests.datas...
return BeautifulSoup(html_data)
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>""" Test suite for the embedded <script> extraction """ from BeautifulSoup import BeautifulSoup from nose.tools import raises, eq_ from csxj.datasources.parser_tools import media_utils from csxj.datasources.parser_tools import twitter_utils from tests.datas...
def setUp(self): self.netloc = 'foo.com' self.internal_sites = {} def test_embedded_script(self): """ The embedded <script> extraction works on a simple embedded script with <noscript> fallback """ html_data = """ <div> <script src='http://bar.com/some_widget...
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>""" Test suite for the embedded <script> extraction """ from BeautifulSoup import BeautifulSoup from nose.tools import raises, eq_ from csxj.datasources.parser_tools import media_utils from csxj.datasources.parser_tools import twitter_utils from tests.datas...
self.netloc = 'foo.com' self.internal_sites = {}
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>""" Test suite for the embedded <script> extraction """ from BeautifulSoup import BeautifulSoup from nose.tools import raises, eq_ from csxj.datasources.parser_tools import media_utils from csxj.datasources.parser_tools import twitter_utils from tests.datas...
""" The embedded <script> extraction works on a simple embedded script with <noscript> fallback """ html_data = """ <div> <script src='http://bar.com/some_widget.js'> </script> * <noscript> <a href='http://bar.com/some_resource'>Disabled JS, go ...
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>""" Test suite for the embedded <script> extraction """ from BeautifulSoup import BeautifulSoup from nose.tools import raises, eq_ from csxj.datasources.parser_tools import media_utils from csxj.datasources.parser_tools import twitter_utils from tests.datas...
""" The embedded <script> extraction raises a ValueError exception when encountering a script without <noscript> fallback """ html_data = """ <div> <script src='http://bar.com/some_widget.js'> </script> </div> """ soup = make_soup(html_data) ...
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>""" Test suite for the embedded <script> extraction """ from BeautifulSoup import BeautifulSoup from nose.tools import raises, eq_ from csxj.datasources.parser_tools import media_utils from csxj.datasources.parser_tools import twitter_utils from tests.datas...
""" The embedded <script> extraction returns a link to a twitter resource when the script is a twitter widget """ html_data = """ <div> <script src={0}> {1} </script> </div> """.format(twitter_utils.TWITTER_WIDGET_SCRIPT_URL, test_twitter_utils...
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>""" Test suite for the embedded <script> extraction """ from BeautifulSoup import BeautifulSoup from nose.tools import raises, eq_ from csxj.datasources.parser_tools import media_utils from csxj.datasources.parser_tools import twitter_utils from tests.datas...
""" The embedded <script> extraction raises a ValueError when processing a <script> tag with arbitrary Javascript code inside """ js_content = """<script type='text/javascript'>var pokey='penguin'; </script>""" soup = make_soup(js_content) media_utils.extract_tagged_url_from_embedded_scr...
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>""" Test suite for the embedded <script> extraction """ from BeautifulSoup import BeautifulSoup from nose.tools import raises, eq_ from csxj.datasources.parser_tools import media_utils from csxj.datasources.parser_tools import twitter_utils from tests.datas...
""" The embedded <script> extraction should work when an embedded tweet is split between the widget.js inclusion and the actual javascript code to instantiate it.""" html_data = """ <div> <script src={0}></script> <script> {1} </script> </d...