code: def validate_emoji(maybe_emoji: Optional[str]) -> str:
      if maybe_emoji is None:
          return ""
      elif is_emoji(maybe_emoji):
          return maybe_emoji
      else:
          raise StreamlitAPIException(
              f'The value "{maybe_emoji}" is not a valid emoji. Shortcodes are not allowed, please use a single character instead.'
          )
  
file_path: streamlit/lib/streamlit/string_util.py
imports: import re
  import textwrap
  from typing import TYPE_CHECKING, Any, Optional, Tuple, cast
  from streamlit.emojis import ALL_EMOJIS
  from streamlit.errors import StreamlitAPIException
label_desc: Use image node_id 4 for calling a global function with example usage: validate_emoji(maybe_emoji) and returns: str, maybe_emoji