class_docstr: Python implementation of a format decoder. Override this class and
  add the decoding logic in the :meth:`decode` method.
  
  See :ref:`Writing Your Own File Codec in Python<file-codecs-py>`
docstr: Override to perform the decoding process.
  
  :param buffer: A bytes object with the data to be decoded.
  :returns: A tuple of ``(bytes consumed, errcode)``.
      If finished with decoding return -1 for the bytes consumed.
      Err codes are from :data:`.ImageFile.ERRORS`.
docstr_tok: ["Override","to","perform","the","decoding","process",".",":","param","buffer",":","A","bytes","object","with","the","data","to","be","decoded",".",":","returns",":","A","tuple","of","``","(","bytes","consumed",",","errcode",")","``",".","If","finished","with","decoding","return","-1","for","the","bytes","consumed",".","Err","codes","are","from",":","data",":","`",".ImageFile.ERRORS","`","."]
code: def decode(self, buffer):
      """
      Override to perform the decoding process.
  
      :param buffer: A bytes object with the data to be decoded.
      :returns: A tuple of ``(bytes consumed, errcode)``.
          If finished with decoding return -1 for the bytes consumed.
          Err codes are from :data:`.ImageFile.ERRORS`.
      """
      raise NotImplementedError()
  
imports: import io
  import itertools
  import struct
  import sys
  from .None import Image
  from ._util import is_path
label_desc: Use image node_id 2 for calling the PyDecoder obj's underlying member method code with example usage: obj.decode(buffer) without return types