code: def test_create_test_mode() -> None:
      # test-mode should succeed with a valid experiment.
      command = [
          "det",
          "-m",
          conf.make_master_url(),
          "experiment",
          "create",
          "--test-mode",
          conf.fixtures_path("mnist_pytorch/adaptive_short.yaml"),
          conf.tutorials_path("mnist_pytorch"),
      ]
      output = subprocess.check_output(command, universal_newlines=True)
      assert "Model definition test succeeded" in output
  
      # test-mode should fail when an error is introduced into the trial
      # implementation.
      command = [
          "det",
          "-m",
          conf.make_master_url(),
          "experiment",
          "create",
          "--test-mode",
          conf.fixtures_path("trial_error/const.yaml"),
          conf.fixtures_path("trial_error"),
      ]
      with pytest.raises(subprocess.CalledProcessError):
          subprocess.check_call(command)
  
imports: import json
  import subprocess
  import tempfile
  import pytest
  from determined.common import api, util
  from determined.common.api import bindings
  from determined.experimental import Determined
  from tests import api_utils
  from tests import command
  from tests import config
  from tests import experiment
  from tests.api_utils import determined_test_session
  from tests.cluster.test_checkpoints import wait_for_gc_to_finish
label_desc: Use image node_id 4 for calling a global function with example usage: test_create_test_mode() without return types