code: def test_disable_and_enable_slots() -> None:
      with logged_in_user(conf.ADMIN_CREDENTIALS):
          command = [
              "det",
              "-m",
              conf.make_master_url(),
              "slot",
              "list",
              "--json",
          ]
          output = subprocess.check_output(command).decode()
          slots = json.loads(output)
          assert len(slots) == 1
  
          slot_id, agent_id = slots[0]["slot_id"], slots[0]["agent_id"]
  
          command = [
              "det",
              "-m",
              conf.make_master_url(),
              "slot",
              "disable",
              agent_id,
              slot_id,
          ]
          subprocess.check_call(command)
  
          slot = get_GetSlot(
              api_utils.determined_test_session(),
              agentId=agent_id,
              slotId=slot_id,
          ).slot
          assert slot is not None
          assert slot.enabled is False
  
          command = [
              "det",
              "-m",
              conf.make_master_url(),
              "slot",
              "enable",
              agent_id,
              slot_id,
          ]
          subprocess.check_call(command)
  
          slot = get_GetSlot(
              api_utils.determined_test_session(),
              agentId=agent_id,
              slotId=slot_id,
          ).slot
          assert slot is not None
          assert slot.enabled is True
  
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 1 for calling a global function with example usage: test_disable_and_enable_slots() without return types