code: def test_logout(scenario_set: Logout) -> None:
      for scenario in scenario_set.scenarios():
          with contextlib.ExitStack() as es:
              rsps = es.enter_context(
                  responses.RequestsMock(
                      registry=registries.OrderedRegistry,
                      assert_all_requests_are_fired=True,
                  )
              )
              mts = es.enter_context(util.MockTokenStore(strict=True))
  
              # Configure evironment variables.
              es.enter_context(
                  util.setenv_optional("DET_MASTER", MOCK_MASTER_URL)
              )
              es.enter_context(
                  util.setenv_optional("DET_USER", scenario.user_in_env)
              )
              env_pass = "env_pass" if scenario.user_in_env else None
              es.enter_context(
                  util.setenv_optional("DET_PASS", env_pass)
              )
  
              util.expect_get_info(rsps)
  
              for exp in scenario_set.expected:
                  exp.expect(rsps, mts, scenario)
  
              # Actually call the cli.
              if scenario.user_explicit:
                  cmd = ["-u", "req_user", "user", "logout"]
              else:
                  cmd = ["user", "logout"]
              cli.main(cmd)
  
imports: import collections
  import contextlib
  import itertools
  from typing import Any, Iterator, List, Tuple, no_type_check
  from unittest import mock
  import pytest
  import responses
  from responses import matchers, registries
  from determined.cli import cli
  from determined.common.api import authentication
  from tests.cli import util
label_desc: Use image node_id 2 for calling a global function with example usage: test_logout(scenario_set) without return types