code: def logout(
      master_address: Optional[str],
      requested_user: Optional[str],
      cert: Optional[certs.Cert],
  ) -> None:
      """
      Logout if there is an active session for this master/username pair, otherwise do nothing.
  
      Additionally, if the user happens to be the active user, drop the active user from the
      TokenStore.
      """
  
      master_address = (
          master_address or util.get_default_master_address()
      )
      token_store = TokenStore(master_address)
  
      session_user, _ = default_load_user_password(
          requested_user, None, token_store
      )
      # Don't log out of DEFAULT_DETERMINED_USER when it's not specified and not the active user.
  
      if session_user is None:
          return
  
      if session_user == token_store.get_active_user():
          token_store.clear_active()
  
      session_token = token_store.get_token(session_user)
  
      if session_token is None:
          return
  
      token_store.drop_user(session_user)
  
      auth = LogoutAuthentication(session_user, session_token)
      sess = api.Session(
          user=session_user, master=master_address, auth=auth, cert=cert
      )
      try:
          bindings.post_Logout(sess)
      except (
          api.errors.UnauthenticatedException,
          api.errors.APIException,
      ):
          # This session may have expired, but we don't care.
          pass
  
imports: import argparse
  import contextlib
  import functools
  import getpass
  import hashlib
  import json
  import pathlib
  from typing import Any, Callable, Dict, Iterator, List, NamedTuple, Optional, Tuple, cast
  import filelock
  import determined
  from determined.common import api, constants, util
  from determined.common.api import bindings, certs
label_desc: Use image node_id 5 for calling a global function with example usage: logout(master_address, requested_user, cert) without return types