code: def test_experiment_archive_unarchive() -> None:
      experiment_id = exp.create_experiment(
          conf.fixtures_path("no_op/single.yaml"),
          conf.fixtures_path("no_op"),
          ["--paused"],
      )
  
      describe_args = [
          "det",
          "-m",
          conf.make_master_url(),
          "experiment",
          "describe",
          "--json",
          str(experiment_id),
      ]
  
      # Check that the experiment is initially unarchived.
      infos = json.loads(subprocess.check_output(describe_args))
      assert len(infos) == 1
      assert not infos[0]["experiment"]["archived"]
  
      # Check that archiving a non-terminal experiment fails, then terminate it.
      with pytest.raises(subprocess.CalledProcessError):
          subprocess.check_call(
              [
                  "det",
                  "-m",
                  conf.make_master_url(),
                  "experiment",
                  "archive",
                  str(experiment_id),
              ]
          )
      subprocess.check_call(
          [
              "det",
              "-m",
              conf.make_master_url(),
              "experiment",
              "cancel",
              str(experiment_id),
          ]
      )
  
      # Check that we can archive and unarchive the experiment and see the expected effects.
      subprocess.check_call(
          [
              "det",
              "-m",
              conf.make_master_url(),
              "experiment",
              "archive",
              str(experiment_id),
          ]
      )
      infos = json.loads(subprocess.check_output(describe_args))
      assert len(infos) == 1
      assert infos[0]["experiment"]["archived"]
  
      subprocess.check_call(
          [
              "det",
              "-m",
              conf.make_master_url(),
              "experiment",
              "unarchive",
              str(experiment_id),
          ]
      )
      infos = json.loads(subprocess.check_output(describe_args))
      assert len(infos) == 1
      assert not infos[0]["experiment"]["archived"]
  
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 3 for calling a global function with example usage: test_experiment_archive_unarchive() without return types