parameters: (self, ch, unicode)
docstring: Canonicalize a character per ES9 21.2.2.8.2.
docstring_summary: Canonicalize a character per ES9 21.2.2.8.2.
docstring_tokens: Canonicalize a character per ES9 21 . 2 . 2 . 8 . 2 .
function: def canonicalize(self, ch, unicode):
          """Canonicalize a character per ES9 21.2.2.8.2."""
          if unicode:
              return self.folds[ch]
          else:
              upper_ch = self.toupper[ch]
              # "If u does not consist of a single character, return ch"
              # We only store 1-1 mappings.
              # "If ch's code unit value is greater than or equal to decimal 128
              # and cu's code unit value is less than decimal 128, then return ch"
              # That is, only ASCII may canonicalize to ASCII.
              if upper_ch < 128 and ch >= 128:
                  return ch
              return upper_ch
function_tokens: def canonicalize ( self , ch , unicode ) : if unicode : return self . folds [ ch ] else : upper_ch = self . toupper [ ch ] # "If u does not consist of a single character, return ch" # We only store 1-1 mappings. # "If ch's code unit value is greater than or equal to decimal 128 # and cu's code unit value is less than decimal 128, then return ch" # That is, only ASCII may canonicalize to ASCII. if upper_ch < 128 and ch >= 128 : return ch return upper_ch