code: def get_config(*, section: str | None = None) -> Response:
      """Get current configuration."""
      serializer = {
          "text/plain": _config_to_text,
          "application/json": _config_to_json,
      }
      return_type = request.accept_mimetypes.best_match(
          serializer.keys()
      )
      if (
          conf.get("webserver", "expose_config").lower()
          == "non-sensitive-only"
      ):
          expose_config = True
          display_sensitive = False
      else:
          expose_config = conf.getboolean("webserver", "expose_config")
          display_sensitive = True
  
      if return_type not in serializer:
          return Response(status=HTTPStatus.NOT_ACCEPTABLE)
      elif expose_config:
          if section and not conf.has_section(section):
              raise NotFound(
                  "section not found.",
                  detail=f"section={section} not found.",
              )
          conf_dict = conf.as_dict(
              display_source=False, display_sensitive=display_sensitive
          )
          if section:
              conf_section_value = conf_dict[section]
              conf_dict.clear()
              conf_dict[section] = conf_section_value
          config = _conf_dict_to_config(conf_dict)
          config_text = serializer[return_type](config)
          return Response(
              config_text, headers={"Content-Type": return_type}
          )
      else:
          raise PermissionDenied(
              detail=(
                  "Your Airflow administrator chose not to expose the configuration, most likely for security"
                  " reasons."
              )
          )
  
file_path: airflow/airflow/api_connexion/endpoints/config_endpoint.py
imports: from __future__ import annotations
  from http import HTTPStatus
  from flask import Response, request
  from airflow.api_connexion import security
  from airflow.api_connexion.exceptions import NotFound, PermissionDenied
  from airflow.api_connexion.schemas.config_schema import Config, ConfigOption, ConfigSection, config_schema
  from airflow.configuration import conf
  from airflow.settings import json
label_desc: Use image node_id 6 for calling a global function with example usage: get_config() and returns: Response, Response