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