def parse_headers(buff):
preamble_lines = list(map(<EOL>lambda x: six.u(x).decode(),<EOL>iter(lambda: buff.readline().strip(), b'<STR_LIT>'))<EOL>)<EOL>if not preamble_lines:<EOL><INDENT>raise EmptyBuffer()<EOL><DEDENT>return preamble_lines[<NUM_LIT:0>], OrderedDict([l.split('<STR_LIT::>') for l in preamble_lines[<NUM_LIT:1>:]])<EOL>
Parses buffer and returns command and headers as strings