code: def load_config(filename=None):
      
      try:
          with _config_stream(filename) as handle:
              filename = handle.name
              return deserialize_config(handle.read())
      except (OSError, toml.TomlDecodeError, UnicodeDecodeError) as exc:
          raise ConfigError(
              'Error loading configuration from {}'.format(filename)) from exc
docs: Load a configuration from a file or stdin.
  
      If `filename` is `None` or "-", then configuration gets read from stdin.
  
      Returns: A `ConfigDict`.
  
      Raises: ConfigError: If there is an error loading the config.