code: def read_endpoint_config(
      filename: Text, endpoint_type: Text
  ) -> Optional["EndpointConfig"]:
      """Read an endpoint configuration file from disk and extract one config."""  # noqa: E501
      if not filename:
          return None
  
      try:
          content = rasa.shared.utils.io.read_config_file(filename)
  
          if content.get(endpoint_type) is None:
              return None
  
          return EndpointConfig.from_dict(content[endpoint_type])
      except FileNotFoundError:
          logger.error(
              "Failed to read endpoint configuration "
              "from {}. No such file.".format(os.path.abspath(filename))
          )
          return None
  
imports: import ssl
  from functools import cached_property
  import aiohttp
  import logging
  import os
  from aiohttp.client_exceptions import ContentTypeError
  from sanic.request import Request
  from typing import Any, Optional, Text, Dict
  from rasa.shared.exceptions import FileNotFoundException
  import rasa.shared.utils.io
  import rasa.utils.io
  from rasa.core.constants import DEFAULT_REQUEST_TIMEOUT
label_desc: Use image node_id 1 for calling a global function with example usage: read_endpoint_config(filename, endpoint_type) and returns: None, EndpointConfig, None, None