class_docstr: Python implementation of a format decoder. Override this class and
  add the decoding logic in the `decode` method.
  
  See :ref:`Writing Your Own File Decoder in Python<file-decoders-py>`
class_docstr_tok: ["Python","implementation","of","a","format","decoder",".","Override","this","class","and","add","the","decoding","logic","in","the","`","decode","`","method",".","See",":","ref",":","`","Writing","Your","Own","File","Decoder","in","Python","<","file-decoders-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 <0 for the bytes consumed.
      Err codes are from `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","<","0","for","the","bytes","consumed",".","Err","codes","are","from","`","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 <0 for the bytes consumed.
          Err codes are from `ERRORS`
      """
      raise NotImplementedError()
  
imports: import io
  import struct
  import sys
  from .None import Image
  from ._util import isPath
label_desc: Use image node_id 4 for calling the PyDecoder obj's underlying member method code with example usage: obj.decode(buffer) without return types