code: def test_start_and_write_to_shell(tmp_path: Path) -> None:
      with cmd.interactive_command("shell", "start") as shell:
          # Call our cli to ensure that PATH and PYTHONUSERBASE are properly set.
          shell.stdin.write(b"COLUMNS=80 det --version\n")
          # Exit the shell, so we can read output below until EOF instead of timeout
          shell.stdin.write(b"exit\n")
          shell.stdin.close()
  
          lines = ""
          for line in shell.stdout:
              if str(det.__version__) in line:
                  break
              lines += "OUTPUT:" + line
          else:
              pytest.fail(
                  f"Did not find expected input {det.__version__} in shell stdout."
                  + lines
                  + "\n"
              )
  
imports: from pathlib import Path
  import pytest
  import determined
  from tests import command
  from tests.cluster import test_users
label_desc: Use image node_id 1 for calling a global function with example usage: test_start_and_write_to_shell(tmp_path) without return types