code: def getchunks(im, **params):
      """Return a list of PNG chunks representing this image."""
  
      class collector(object):
          data = []
  
          def write(self, data):
              pass
  
          def append(self, chunk):
              self.data.append(chunk)
  
      def append(fp, cid, *data):
          data = b"".join(data)
          crc = o32(_crc32(data, _crc32(cid)))
          fp.append((cid, data, crc))
  
      fp = collector()
  
      try:
          im.encoderinfo = params
          _save(im, fp, None, append)
      finally:
          del im.encoderinfo
  
      return fp.data
  
imports: import logging
  import re
  import struct
  import zlib
  from .None import Image, ImageFile, ImagePalette
  from ._binary import i8, i16be, i32be, o16be, o32be
  from ._util import py3
label_desc: Use image node_id 6 for calling a global function with example usage: getchunks(im) and returns: fp