code: def _validate_story_structure(
      validator: "Validator",
      max_history: Optional[int],
      fail_on_warnings: bool,
  ) -> bool:
      # Check if a valid setting for `max_history` was given
      if isinstance(max_history, int) and max_history < 1:
          raise argparse.ArgumentTypeError(
              f"The value of `--max-history {max_history}` "
              f"is not a positive integer."
          )
  
      return validator.verify_story_structure(
          not fail_on_warnings, max_history=max_history
      )
  
imports: import json
  import argparse
  import logging
  import os
  import sys
  import time
  from types import FrameType
  from typing import Any, Dict, List, Optional, TYPE_CHECKING, Text, Union, overload
  import randomname
  import rasa.shared.utils.cli
  import rasa.shared.utils.io
  from rasa.shared.importers.importer import TrainingDataImporter
  from rasa.shared.constants import ASSISTANT_ID_DEFAULT_VALUE, ASSISTANT_ID_KEY, DEFAULT_CONFIG_PATH
  from rasa.shared.utils.cli import print_error
  from rasa import telemetry
label_desc: Use image node_id 12 for calling a global function with example usage: _validate_story_structure(validator, max_history, fail_on_warnings) and returns: validator