Loop for group of list

Try this.

row = IN[0]
col = len(row[0])
r = 0
out = []

while r+1 < len(row):
	c = 0
	while c+1 < col:
		quad = [row[r][c],row[r][c+1],row[r+1][c],row[r+1][c+1]]
		out.append(quad)
		c = c+1
	r=r+1

OUT = out