code: def validate_training_data_format_version(
      yaml_file_content: Dict[Text, Any], filename: Optional[Text]
  ) -> bool:
      """Validates version on the training data content using `version` field
         and warns users if the file is not compatible with the current version of
         Rasa Open Source.
  
      Args:
          yaml_file_content: Raw content of training data file as a dictionary.
          filename: Name of the validated file.
  
      Returns:
          `True` if the file can be processed by current version of Rasa Open Source,
          `False` otherwise.
      """
      if filename:
          filename = os.path.abspath(filename)
  
      if not isinstance(yaml_file_content, dict):
          raise YamlValidationException(
              "YAML content in is not a mapping, can not validate training "
              "data schema version.",
              filename=filename,
          )
  
      version_value = yaml_file_content.get(
          KEY_TRAINING_DATA_FORMAT_VERSION
      )
  
      if not version_value:
          # not raising here since it's not critical
          logger.info(
              f"The '{KEY_TRAINING_DATA_FORMAT_VERSION}' key is missing in "
              f"the training data file {filename}. "
              f"Rasa Open Source will read the file as a "
              f"version '{LATEST_TRAINING_DATA_FORMAT_VERSION}' file. "
              f"See {DOCS_URL_TRAINING_DATA}."
          )
          return True
  
      try:
          if isinstance(version_value, str):
              version_value = version_value.strip("\"'")
          parsed_version = version.parse(version_value)
          latest_version = version.parse(
              LATEST_TRAINING_DATA_FORMAT_VERSION
          )
  
          if isinstance(parsed_version, LegacyVersion):
              raise TypeError
  
          if parsed_version < latest_version:
              rasa.shared.utils.io.raise_warning(
                  f"Training data file {filename} has a lower "
                  f"format version than your Rasa Open Source installation: "
                  f"{version_value} < {LATEST_TRAINING_DATA_FORMAT_VERSION}. "
                  f"Rasa Open Source will read the file as a version "
                  f"{LATEST_TRAINING_DATA_FORMAT_VERSION} file. "
                  f"Please update your version key to "
                  f"{LATEST_TRAINING_DATA_FORMAT_VERSION}. "
                  f"See {DOCS_URL_TRAINING_DATA}."
              )
  
          if latest_version >= parsed_version:
              return True
  
      except TypeError:
          rasa.shared.utils.io.raise_warning(
              f"Training data file {filename} must specify "
              f"'{KEY_TRAINING_DATA_FORMAT_VERSION}' as string, for example:\n"
              f"{KEY_TRAINING_DATA_FORMAT_VERSION}: "
              f"'{LATEST_TRAINING_DATA_FORMAT_VERSION}'\n"
              f"Rasa Open Source will read the file as a "
              f"version '{LATEST_TRAINING_DATA_FORMAT_VERSION}' file.",
              docs=DOCS_URL_TRAINING_DATA,
          )
          return True
  
      rasa.shared.utils.io.raise_warning(
          f"Training data file {filename} has a greater "
          f"format version than your Rasa Open Source installation: "
          f"{version_value} > {LATEST_TRAINING_DATA_FORMAT_VERSION}. "
          f"Please consider updating to the latest version of Rasa Open Source."
          f"This file will be skipped.",
          docs=DOCS_URL_TRAINING_DATA,
      )
      return False
  
imports: import logging
  import os
  from typing import Text, Dict, List, Optional, Any
  from packaging import version
  from packaging.version import LegacyVersion
  from pykwalify.errors import SchemaError
  from ruamel.yaml.constructor import DuplicateKeyError
  import rasa.shared
  from rasa.shared.exceptions import YamlException, YamlSyntaxException, SchemaValidationError
  import rasa.shared.utils.io
  from rasa.shared.constants import DOCS_URL_TRAINING_DATA, PACKAGE_NAME, LATEST_TRAINING_DATA_FORMAT_VERSION, SCHEMA_EXTENSIONS_FILE, RESPONSES_SCHEMA_FILE
label_desc: Use image node_id 3 for calling a global function with example usage: validate_training_data_format_version(yaml_file_content, filename) and returns: False, True, True, True