def parse_inline(text):
    """
    Takes a string of text from a text inline and returns a 3 tuple of
    (name, value, **kwargs).
    """

    m = INLINE_SPLITTER.match(text)
    if not m:
        raise InlineUnparsableError
    args = m.group('args')
    name = m.group('name')
    value = ""
    kwtxt = ""
    kwargs = {}
    if args:
        kwtxt = INLINE_KWARG_PARSER.search(args).group('kwargs')
        value = re.sub(kwtxt % "%s\Z", "", args)
        value = value.strip()
    if m.group('variant'):
        kwargs['variant'] = m.group('variant')
    if kwtxt:
        for kws in kwtxt.split():
            k, v = kws.split('=')
            kwargs[str(k)] = v
    return (name, value, kwargs)
dataset/ETHPy150Open mintchaos/django_inlines/django_inlines/inlines.py/parse_inline/swapped operands of `%`