code: def test_cmd_kill() -> None:
      """Start a command, extract its task ID, and then kill it."""
  
      with cmd.interactive_command(
          "command",
          "run",
          "echo hello world; echo hello world; sleep infinity",
      ) as command:
          assert command.task_id is not None
          for line in command.stdout:
              if "hello world" in line:
                  # For HPC job, dispatcher does the polling of the job state happens
                  # every 10 seconds. For example, it is very likely the current job state is
                  # STATE_PULLING when job is actually running on HPC. So instead of checking
                  # for STATE_RUNNING, we check for other active states as well.
                  assert cmd.get_num_active_commands() == 1
                  break
  
imports: import copy
  import re
  import subprocess
  import tempfile
  import time
  from pathlib import Path
  from typing import Any, Dict, List, Optional
  import docker
  import docker.errors
  import pytest
  from determined.common import util
  from tests import command
  from tests import config
  from tests.filetree import FileTree
label_desc: Use image node_id 17 for calling a global function with example usage: test_cmd_kill() without return types