code: def _unescape_fixup(match):
      """
      Replace one matched HTML entity with the character it represents,
      if possible.
      """
      text = match.group(0)
      if text in HTML_ENTITIES:
          return HTML_ENTITIES[text]
      elif text.startswith("&#"):
          unescaped = html.unescape(text)
  
          # If html.unescape only decoded part of the string, that's not what
          # we want. The semicolon should be consumed.
          if ";" in unescaped:
              return text
          else:
              return unescaped
      else:
          return text
  
imports: import codecs
  import html
  import re
  import warnings
  import ftfy
  from ftfy.chardata import ALTERED_UTF8_RE, C1_CONTROL_RE, CONTROL_CHARS, DOUBLE_QUOTE_RE, HTML_ENTITIES, HTML_ENTITY_RE, LIGATURES, LOSSY_UTF8_RE, SINGLE_QUOTE_RE, UTF8_DETECTOR_RE, WIDTH_MAP
  from ftfy.badness import is_bad
label_desc: Use image node_id 4 for calling a global function with example usage: _unescape_fixup(match) and returns: HTML_ENTITIES, text, text, unescaped