code: def test_disable_agent_zero_slots() -> None:
      """
      Start a command, disable the agent it's running on. The command should
      then be terminated promptly.
      """
      slots = _fetch_slots()
      assert len(slots) == 1
      agent_id = slots[0]["agent_id"]
  
      command_id = run_zero_slot_command(sleep=180)
      # Wait for it to run.
      wait_for_command_state(command_id, "RUNNING", 300)
  
      try:
          with _disable_agent(agent_id):
              wait_for_command_state(command_id, "TERMINATED", 30)
      finally:
          # Kill the command before failing so it does not linger.
          command = [
              "det",
              "-m",
              conf.make_master_url(),
              "command",
              "kill",
              command_id,
          ]
          subprocess.check_call(command)
  
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 6 for calling a global function with example usage: test_disable_agent_zero_slots() without return types