code: def add_validate_before_train(
      parser: Union[argparse.ArgumentParser, argparse._ActionsContainer]
  ) -> None:
      """Adds parameters for validating the domain and data files before training.
  
      Args:
          parser: An instance of `ArgumentParser` or `_ActionsContainer`.
      """
      parser.add_argument(
          "--skip-validation",
          default=False,
          action="store_true",
          help="Skip validation step before training.",
      )
  
      parser.add_argument(
          "--fail-on-validation-warnings",
          default=False,
          action="store_true",
          help="Fail on validation warnings. "
          "If omitted only errors will exit with a non zero status code",
      )
  
      parser.add_argument(
          "--validation-max-history",
          type=int,
          default=None,
          help="Number of turns taken into account for story structure validation.",
      )
  
imports: import argparse
  from typing import Union
  from rasa.cli.arguments.default_arguments import add_config_param, add_stories_param, add_nlu_data_param, add_out_param, add_domain_param, add_endpoint_param
  from rasa.graph_components.providers.training_tracker_provider import TrainingTrackerProvider
  from rasa.shared.constants import DEFAULT_CONFIG_PATH, DEFAULT_DATA_PATH
label_desc: Use image node_id 9 for calling a global function with example usage: add_validate_before_train(parser) without return types