def paged(query, size=1000):
 offset = 0
 while True:
  page = query.offset(offset).limit(size).execute()
  if (page.rowcount <= 0):
   break
  for row in page:
   (yield row)
  offset += size

def paged ( query , size = 1000 ) : offset = 0 while True : page = query . offset ( offset ) . limit ( size ) . execute ( ) if ( page . rowcount <= 0 ) : break for row in page : ( yield row ) offset += size
page query results .