code: def _build_html_entities():
      entities = {}
      # Create a dictionary based on the built-in HTML5 entity dictionary.
      # Add a limited set of HTML entities that we'll also decode if they've
      # been case-folded to uppercase, such as decoding &NTILDE; as "Ñ".
      for name, char in html.entities.html5.items():  # type: ignore
          if name.endswith(";"):
              entities["&" + name] = char
  
              # Restrict the set of characters we can attempt to decode if their
              # name has been uppercased. If we tried to handle all entity names,
              # the results would be ambiguous.
              if name == name.lower():
                  name_upper = name.upper()
                  entity_upper = "&" + name_upper
                  if html.unescape(entity_upper) == entity_upper:
                      entities[entity_upper] = char.upper()
      return entities
  
file_path: python-ftfy/ftfy/chardata.py
imports: from __future__ import annotations
  import html
  import itertools
  import re
  import unicodedata
label_desc: Use image node_id 2 for calling a global function with example usage: _build_html_entities() and returns: entities