def read_chunk(fp):
 chunk = []
 lines = []
 while 1:
  line = fp.readline()
  if (not line):
   break
  if (line == sep1):
   if lines:
    chunk.append(lines)
   break
  if (line == sep2):
   if lines:
    chunk.append(lines)
    lines = []
  else:
   lines.append(line)
 return chunk

def read_chunk ( fp ) : chunk = [ ] lines = [ ] while 1 : line = fp . readline ( ) if ( not line ) : break if ( line == sep1 ) : if lines : chunk . append ( lines ) break if ( line == sep2 ) : if lines : chunk . append ( lines ) lines = [ ] else : lines . append ( line ) return chunk
read a chunk -- data for one file .