code: def get_queue_id(session, queue):
      # type: ('Session', str) -> Optional[str] # noqa: F821
      if not queue:
          return None
  
      res = session.send(queues.GetByIdRequest(queue=queue))
      if res and res.response.queue:
          return queue
      res = session.send(
          queues.GetAllRequest(
              name=exact_match_regex(queue), only_fields=["id"]
          )
      )
      if res and res.response and res.response.queues:
          if len(res.response.queues) > 1:
              LoggerRoot.get_base_logger().info(
                  "Multiple queues with name={}, selecting queue id={}".format(
                      queue, res.response.queues[0].id
                  )
              )
          return res.response.queues[0].id
  
      return None
  
imports: import getpass
  import re
  from _socket import gethostname
  from datetime import datetime
  from typing import Optional, Any
  from ..backend_api.services import projects, queues
  from ..debugging.log import get_logger, LoggerRoot
label_desc: Use image node_id 6 for calling a global function with example usage: get_queue_id(session, queue) and returns: None, None, queue, res