code: def decode(self, input, errors="strict"):
      if len(input) < 3:
          if codecs.BOM_UTF8.startswith(input):
              # not enough data to decide if this is a BOM
              # => try again on the next call
              return ("", 0)
      elif input[:3] == codecs.BOM_UTF8:
          self.decode = codecs.utf_8_decode
          (output, consumed) = codecs.utf_8_decode(input[3:], errors)
          return (output, consumed + 3)
      # (else) no BOM present
      self.decode = codecs.utf_8_decode
      return codecs.utf_8_decode(input, errors)
  
imports: import codecs
label_desc: Use image node_id 2 for calling the StreamReader obj's underlying member method code with example usage: obj.decode(input, errors) and returns: codecs, str,  int, output,  unknown