code: def _process(string):
      def escape(matchobj):
          codepoint = ord(matchobj.group(0))
  
          name = codepoint2name.get(codepoint)
          if name is None:
              return "&#%d;" % codepoint
          else:
              return "&%s;" % name
  
      return re.sub(r"[^\x00-\x7F]", escape, string)
  
file_path: cpython/Doc/tools/extensions/escape4chm.py
imports: import pathlib
  import re
  from html.entities import codepoint2name
  from sphinx.util.logging import getLogger
label_desc: Use image node_id 1 for calling a global function with example usage: _process(string) and returns: re, unknown, unknown