code: def chars_to_ranges(s):
      """
      Return a list of character codes consisting of pairs
      [code1a, code1b, code2a, code2b,...] which cover all
      the characters in |s|.
      """
      char_list = list(s)
      char_list.sort()
      i = 0
      n = len(char_list)
      result = []
      while i < n:
          code1 = ord(char_list[i])
          code2 = code1 + 1
          i += 1
          while i < n and code2 >= ord(char_list[i]):
              code2 += 1
              i += 1
          result.append(code1)
          result.append(code2)
      return result
  
imports: from __future__ import absolute_import
  import types
  from .None import Errors
label_desc: Use image node_id 1 for calling a global function with example usage: chars_to_ranges(s) and returns: result