'Parse `string` and return `self.key_value_class()` instance.
The best of `self.separators` is determined (first found, longest).
Back slash escaped characters aren\'t considered as separators
(or parts thereof). Literal back slash characters have to be escaped
as well (r\'\\').'

def __call__(self, string):

    class Escaped(str, ):
        'Represents    an    escaped    character.'
    def tokenize(string):
        "Tokenize    `string`.    There    are    only    two    token    types    -    strings\n                                                and    escaped    characters:\n\n                                                tokenize(r'foo\\=bar\\baz')\n                                                =>    ['foo',    Escaped('='),    'bar',    Escaped('\\'),    'baz']\n\n                                                "
        tokens = ['']
        characters = iter(string)
        for char in characters:
            if (char == '\\'):
                char = next(characters, '')
                if (char not in self.special_characters):
                    tokens[(-1)] += ('\\' + char)
                else:
                    tokens.extend([Escaped(char), ''])
            else:
                tokens[(-1)] += char
        return tokens
    tokens = tokenize(string)
    separators = sorted(self.separators, key=len)
    for (i, token) in enumerate(tokens):
        if isinstance(token, Escaped):
            continue
        found = {}
        for sep in separators:
            pos = token.find(sep)
            if (pos != (-1)):
                found[pos] = sep
        if found:
            sep = found[min(found.keys())]
            (key, value) = token.split(sep, 1)
            key = (''.join(tokens[:i]) + key)
            value += ''.join(tokens[(i + 1):])
            break
    else:
        raise ArgumentTypeError((u'"%s"    is    not    a    valid    value' % string))
    return self.key_value_class(key=key, value=value, sep=sep, orig=string)
