code: def test_early_exit_on_invalid_domain():
      domain_path = "data/test_domains/duplicate_intents.yml"
  
      importer = RasaFileImporter(domain_path=domain_path)
      with pytest.warns(UserWarning) as record:
          warnings.simplefilter("ignore", DeprecationWarning)
          validator = Validator.from_importer(importer)
      validator.verify_domain_validity()
  
      # two for non-unique domains, 2 for auto-fill removal
      assert len(record) == 4
  
      non_unique_warnings = list(
          filter(
              lambda warning: f"Loading domain from '{domain_path}' failed. "
              f"Using empty domain. Error: 'Intents are not unique! "
              f"Found multiple intents with name(s) ['default', 'goodbye']. "
              f"Either rename or remove the duplicate ones.'"
              in warning.message.args[0],
              record,
          )
      )
      assert len(non_unique_warnings) == 2
  
      auto_fill_warnings = list(
          filter(
              lambda warning: "Slot auto-fill has been removed in 3.0"
              in warning.message.args[0],
              record,
          )
      )
      assert len(auto_fill_warnings) == 2
  
imports: import textwrap
  import warnings
  from typing import Text
  import pytest
  from _pytest.logging import LogCaptureFixture
  from rasa.shared.constants import LATEST_TRAINING_DATA_FORMAT_VERSION
  from rasa.validator import Validator
  from rasa.shared.importers.rasa import RasaFileImporter
  from pathlib import Path
label_desc: Use image node_id 19 for calling a global function with example usage: test_early_exit_on_invalid_domain() without return types