code: def array_scanlines_interlace(self, pixels):
          
  
          # http://www.w3.org/TR/PNG/#8InterlaceMethods
          # Array type.
          fmt = 'BH'[self.bitdepth > 8]
          # Value per row
          vpr = self.width * self.planes
  
          # Each iteration generates a scanline starting at (x, y)
          # and consisting of every xstep pixels.
          for lines in adam7_generate(self.width, self.height):
              for x, y, xstep in lines:
                  # Pixels per row (of reduced image)
                  ppr = int(math.ceil((self.width - x) / float(xstep)))
                  # Values per row (of reduced image)
                  reduced_row_len = ppr * self.planes
                  if xstep == 1:
                      # Easy case: line is a simple slice.
                      offset = y * vpr
                      yield pixels[offset: offset + vpr]
                      continue
                  # We have to step by xstep,
                  # which we can do one plane at a time
                  # using the step in Python slices.
                  row = array(fmt)
                  # There's no easier way to set the length of an array
                  row.extend(pixels[0:reduced_row_len])
                  offset = y * vpr + x * self.planes
                  end_offset = (y + 1) * vpr
                  skip = self.planes * xstep
                  for i in range(self.planes):
                      row[i::self.planes] = \
                          pixels[offset + i: end_offset: skip]
                  yield row
docs: Generator for interlaced scanlines from an array.
          `pixels` is the full source image as a single array of values.
          The generator yields each scanline of the reduced passes in turn,
          each scanline being a sequence of values.