code: def parse_training_example(
      example: Text, intent: Optional[Text] = None
  ) -> "Message":
      """Extract entities and synonyms, and convert to plain text."""
      entities = find_entities_in_training_example(example)
      plain_text = replace_entities(example)
  
      return Message.build(plain_text, intent, entities)
  
file_path: rasa/rasa/shared/nlu/training_data/entities_parser.py
imports: import re
  from json import JSONDecodeError
  from typing import Text, List, Dict, Match, Optional, NamedTuple, Any
  import logging
  import rasa.shared.nlu.training_data.util
  from rasa.shared.constants import DOCS_URL_TRAINING_DATA_NLU
  from rasa.shared.exceptions import InvalidEntityFormatException
  from rasa.shared.nlu.constants import ENTITY_ATTRIBUTE_VALUE, ENTITY_ATTRIBUTE_TYPE, ENTITY_ATTRIBUTE_GROUP, ENTITY_ATTRIBUTE_ROLE
  from rasa.shared.nlu.training_data.message import Message
label_desc: Use image node_id 6 for calling a global function with example usage: parse_training_example(example, intent) and returns: Message