code: def encode(self, input, errors="strict"):
      if errors != "strict":
          # IDNA is quite clear that implementations must be strict
          raise UnicodeError("unsupported error handling " + errors)
  
      if not input:
          return "", 0
  
      result = []
      labels = dots.split(input)
      if labels and len(labels[-1]) == 0:
          trailing_dot = "."
          del labels[-1]
      else:
          trailing_dot = ""
      for label in labels:
          result.append(ToASCII(label))
      # Join with U+002E
      return ".".join(result) + trailing_dot, len(input)
  
imports: import stringprep, re, codecs
  from unicodedata import ucd_3_2_0
label_desc: Use image node_id 1 for calling the Codec obj's underlying member method code with example usage: obj.encode(input, errors) and returns: unknown,  len, str,  int