'Parses the next space separated entry as a KEY=VALUE mapping, removing it
and the space from our remaining content.
:param bool quoted: parses the value as being quoted, removing the quotes
:param bool escaped: unescapes the CONTROL_ESCAPES escape sequences
:returns: **tuple** of the form (key, value)
:raises: **ValueError** if this isn\'t a KEY=VALUE mapping or if quoted is
**True** without the value being quoted
:raises: **IndexError** if there\'s nothing to parse from the line'

def pop_mapping(self, quoted=False, escaped=False):

    with self._remainder_lock:
        if self.is_empty():
            raise IndexError('no    remaining    content    to    parse')
        key_match = KEY_ARG.match(self._remainder)
        if (not key_match):
            raise ValueError(("the    next    entry    isn't    a    KEY=VALUE    mapping:    " + self._remainder))
        key = key_match.groups()[0]
        remainder = self._remainder[key_match.end():]
        (next_entry, remainder) = _parse_entry(remainder, quoted, escaped)
        self._remainder = remainder
        return (key, next_entry)
