code: def test_intent_with_metadata_is_parsed():
      parser = RasaYAMLReader()
  
      with warnings.catch_warnings() as record:
          training_data = parser.reads(INTENT_EXAMPLES_WITH_METADATA)
  
      if record is not None:
          record = filter_expected_warnings(record)
          assert len(record) == 0
  
      assert len(training_data.training_examples) == 7
      (
          example_1,
          example_2,
          *other_examples,
      ) = training_data.training_examples
      assert example_1.get(METADATA) == {
          METADATA_INTENT: ["johnny"],
          METADATA_EXAMPLE: {"sentiment": "positive"},
      }
      assert example_2.get(METADATA) == {
          METADATA_INTENT: ["johnny"],
          METADATA_EXAMPLE: "co2-trip-calculation",
      }
  
imports: import textwrap
  import warnings
  from typing import Text
  import pytest
  import pathlib
  from rasa.shared.exceptions import YamlException, YamlSyntaxException
  import rasa.shared.utils.io
  from rasa.shared.constants import LATEST_TRAINING_DATA_FORMAT_VERSION
  from rasa.shared.nlu.constants import INTENT, METADATA, METADATA_INTENT, METADATA_EXAMPLE
  from rasa.shared.nlu.training_data.formats.rasa_yaml import RasaYAMLReader, RasaYAMLWriter
  from tests.conftest import filter_expected_warnings
label_desc: Use image node_id 4 for calling a global function with example usage: test_intent_with_metadata_is_parsed() without return types