def _iter_lines(byte_iter, line_separator):
 chunks = []
 for data in byte_iter:
  while data:
   (head, sep, data) = data.partition(line_separator)
   if (not sep):
    chunks.append(head)
    break
   chunks.append((head + sep))
   (yield ''.join(chunks))
   chunks = []
 if chunks:
  (yield ''.join(chunks))

def _iter_lines ( byte_iter , line_separator ) : chunks = [ ] for data in byte_iter : while data : ( head , sep , data ) = data . partition ( line_separator ) if ( not sep ) : chunks . append ( head ) break chunks . append ( ( head + sep ) ) ( yield '' . join ( chunks ) ) chunks = [ ] if chunks : ( yield '' . join ( chunks ) )
iterate over the lines that make up content .