code: def check_duplicate_synonym(
      entity_synonyms: Dict[Text, Any],
      text: Text,
      syn: Text,
      context_str: Text = "",
  ) -> None:
      if text in entity_synonyms and entity_synonyms[text] != syn:
          rasa.shared.utils.io.raise_warning(
              f"Found inconsistent entity synonyms while {context_str}, "
              f"overwriting {text}->{entity_synonyms[text]} "
              f"with {text}->{syn} during merge."
          )
  
imports: import json
  import logging
  import os
  import re
  from typing import Any, Dict, Optional, Text, Match, List
  import scipy.sparse
  from rasa.shared.nlu.constants import ENTITIES, EXTRACTOR, PRETRAINED_EXTRACTORS, ENTITY_ATTRIBUTE_START, ENTITY_ATTRIBUTE_END, ENTITY_ATTRIBUTE_VALUE, ENTITY_ATTRIBUTE_TYPE, ENTITY_ATTRIBUTE_ROLE, ENTITY_ATTRIBUTE_GROUP
  from rasa.shared.constants import UTTER_PREFIX
  import rasa.shared.utils.io
  import rasa.shared.data
label_desc: Use image node_id 2 for calling a global function with example usage: check_duplicate_synonym(entity_synonyms, text, syn, context_str) without return types