code: def parse_jupytext_configuration_file(
      jupytext_config_file, stream=None
  ):
      """Read a Jupytext config file, and return a dict"""
      if not jupytext_config_file.endswith(".py") and stream is None:
          with open(jupytext_config_file, encoding="utf-8") as stream:
              return parse_jupytext_configuration_file(
                  jupytext_config_file, stream.read()
              )
  
      try:
          if jupytext_config_file.endswith((".toml", "jupytext")):
              import toml
  
              doc = toml.loads(stream)
              if jupytext_config_file.endswith(PYPROJECT_FILE):
                  return doc["tool"]["jupytext"]
              else:
                  return doc
  
          if jupytext_config_file.endswith((".yml", ".yaml")):
              return yaml.safe_load(stream)
  
          if jupytext_config_file.endswith(".json"):
              return json.loads(stream)
  
          return PyFileConfigLoader(jupytext_config_file).load_config()
      except (ValueError, NameError) as err:
          raise JupytextConfigurationError(
              "The Jupytext configuration file {} is incorrect: {}".format(
                  jupytext_config_file, err
              )
          )
  
imports: import json
  import os
  import warnings
  import yaml
  from traitlets import Bool, Dict, Enum, Float, List, Unicode, Union
  from traitlets.config import Configurable
  from traitlets.config.loader import PyFileConfigLoader
  from traitlets.traitlets import TraitError
  from .formats import NOTEBOOK_EXTENSIONS, long_form_multiple_formats, long_form_one_format, short_form_multiple_formats
label_desc: Use image node_id 5 for calling a global function with example usage: parse_jupytext_configuration_file(jupytext_config_file, stream) and returns: PyFileConfigLoader, parse_jupytext_configuration_file, yaml, json, doc, doc