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",">","`"]
code: def __init__(self, mode, *args):
      self.im = None
      self.state = PyCodecState()
      self.fd = None
      self.mode = mode
      self.init(args)
  
imports: import io
  import struct
  import sys
  from .None import Image
  from ._util import isPath
label_desc: Use image node_id 1 to create a new PyDecoder object from inherited base classes: object with example: obj = PyDecoder(mode)