code: def _task_agents(task_id: str) -> List[str]:
      task_data = _task_data(task_id)
      if not task_data:
          return []
      return [
          a
          for r in task_data.get("resources", [])
          for a in r["agentDevices"]
      ]
  
imports: import contextlib
  import json
  import subprocess
  import time
  from typing import Any, Dict, Iterator, List, Optional, cast
  import pytest
  from determined.common.api.bindings import experimentv1State, get_GetSlot
  from tests import api_utils
  from tests import config
  from tests import experiment
  from .test_users import logged_in_user
  from .utils import assert_command_succeeded, run_zero_slot_command, wait_for_command_state
label_desc: Use image node_id 10 for calling a global function with example usage: _task_agents(task_id) and returns: unknown, list