INNER CODE UNIT · Python

uses_legacy_task_status

yohey-w/multi-agent-shogun · scripts/slim_yaml.py:75

def uses_legacy_task_status(data):
    return isinstance(data, dict) and isinstance(data.get('task'), dict) and 'status' in data['task'] and 'status' not in data


def idle_stub_for(stem, data):
    if uses_legacy_task_status(data):
        return IDLE_STUB
    stub = dict(TOP_LEVEL_IDLE_STUB)
    if stem in CANONICAL_TASKS:
        stub['worker_id'] = stem
    return stub


def is_old_timestamp(value, now=None, age_seconds=INVENTORY_AGE_SECONDS):
    if not value:
        return False
    now = now or datetime.now().astimezone()
    text = str(value)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…