code: def convert_surrogate_pair(match):
      """
      Convert a surrogate pair to the single codepoint it represents.
  
      This implements the formula described at:
      http://en.wikipedia.org/wiki/Universal_Character_Set_characters#Surrogates
      """
      pair = match.group(0)
      codept = (
          0x10000
          + (ord(pair[0]) - 0xD800) * 0x400
          + (ord(pair[1]) - 0xDC00)
      )
      return chr(codept)
  
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 11 for calling a global function with example usage: convert_surrogate_pair(match) and returns: chr