#NEWLINE# def _iter_lines( byte_iter , line_separator ) : #NEWLINE# #INDENT# '\n    Iterate over the lines that make up ``content``.\n\n    :param iter(bytes) byte_iter: An iterable of bytes.\n    :param bytes line_separator: The bytes that mark the end of a line.\n    :yield: Separator-terminated bytestrings.\n    ' #NEWLINE# chunks = [ ] #NEWLINE# for data in byte_iter : #NEWLINE# #INDENT# while data : #NEWLINE# #INDENT# ( head , sep , data ) = data . partition ( line_separator ) #NEWLINE# if ( not sep ) : #NEWLINE# #INDENT# chunks . append ( head ) #NEWLINE# break #NEWLINE# #UNINDENT# chunks . append ( ( head + sep ) ) #NEWLINE# ( yield '' . join ( chunks ) ) #NEWLINE# chunks = [ ] #NEWLINE# #UNINDENT# #UNINDENT# if chunks : #NEWLINE# #INDENT# ( yield '' . join ( chunks ) )