code: def get_auth_name(auth: HTTPAuthType, auth_names: t.List[str]) -> str:
      """Get auth name from auth object."""
      name: str = ""
      if hasattr(auth, "security_scheme_name"):
          name = auth.security_scheme_name  # type: ignore
      if not name:
          if isinstance(auth, HTTPBasicAuth):
              name = "BasicAuth"
          elif isinstance(auth, HTTPTokenAuth):
              if (
                  auth.scheme.lower() == "bearer"
                  and auth.header is None
              ):
                  name = "BearerAuth"
              else:
                  name = "ApiKeyAuth"
          else:
              raise TypeError("Unknown authentication scheme.")
  
      if name in auth_names:
          v = 2
          new_name = f"{name}_{v}"
          while new_name in auth_names:
              v += 1
              new_name = f"{name}_{v}"
          name = new_name
      return name
  
file_path: apiflask/src/apiflask/openapi.py
imports: from __future__ import annotations
  import typing
  from .security import HTTPBasicAuth
  from .security import HTTPTokenAuth
  from .types import HTTPAuthType
label_desc: Use image node_id 3 for calling a global function with example usage: get_auth_name(auth, auth_names) and returns: name