code: def parse_spelling_warnings(
      warning_text: str, docs_dir: str
  ) -> list[SpellingError]:
      """
      Parses warnings from Sphinx.
  
      :param warning_text: warning to parse
      :param docs_dir: documentation directory
      :return: list of SpellingError.
      """
      sphinx_spelling_errors = []
      for sphinx_warning in warning_text.splitlines():
          if not sphinx_warning:
              continue
          warning_parts = None
          match = re.search(
              r"(.*):(\w*):\s\((\w*)\)\s?(\w*)\s?(.*)", sphinx_warning
          )
          if match:
              warning_parts = match.groups()
          if warning_parts and len(warning_parts) == 5:
              try:
                  sphinx_spelling_errors.append(
                      SpellingError(
                          file_path=os.path.join(
                              docs_dir, warning_parts[0]
                          ),
                          line_no=int(warning_parts[1])
                          if warning_parts[1] not in ("None", "")
                          else None,
                          spelling=warning_parts[2],
                          suggestion=warning_parts[3]
                          if warning_parts[3]
                          else None,
                          context_line=warning_parts[4],
                          message=sphinx_warning,
                      )
                  )
              except Exception:
                  # If an exception occurred while parsing the warning message, display the raw warning message.
                  sphinx_spelling_errors.append(
                      SpellingError(
                          file_path=None,
                          line_no=None,
                          spelling=None,
                          suggestion=None,
                          context_line=None,
                          message=sphinx_warning,
                      )
                  )
          else:
              sphinx_spelling_errors.append(
                  SpellingError(
                      file_path=None,
                      line_no=None,
                      spelling=None,
                      suggestion=None,
                      context_line=None,
                      message=sphinx_warning,
                  )
              )
      return sphinx_spelling_errors
  
file_path: airflow/docs/exts/docs_build/spelling_checks.py
imports: from __future__ import annotations
  import os
  import re
  from functools import total_ordering
  from typing import NamedTuple
  from rich.console import Console
  from airflow.utils.code_utils import prepare_code_snippet
  from docs.exts.docs_build.code_utils import CONSOLE_WIDTH
label_desc: Use image node_id 1 for calling a global function with example usage: parse_spelling_warnings(warning_text, docs_dir) and returns: sphinx_spelling_errors