code: def get_jwt_token(request: Optional[Request] = None) -> Optional[str]:
      if not request:
          return None
      # x-api-token is deprecated and will be removed in the future
      if token := request.headers.get("x-api-key"):
          return token
      authorization = request.headers.get("authorization")
      if not authorization:
          return None
      token = authorization.removeprefix("Bearer jwt:")
      return None if token == authorization else token
  
file_path: datasets-server/libs/libapi/src/libapi/authentication.py
imports: import logging
  from collections.abc import Generator
  from typing import Literal, Optional
  import httpx
  from libcommon.prometheus import StepProfiler
  from starlette.requests import Request
  from libapi.exceptions import AuthCheckHubRequestError, ExternalAuthenticatedError, ExternalUnauthenticatedError
  from libapi.jwt_token import validate_jwt
label_desc: Use image node_id 1 for calling a global function with example usage: get_jwt_token(request) and returns: unknown, None, token, None