def _parse_args(argstr, context=None):
    try:
        args = {}
        for token in argstr.split(','):
            if '=' in token:
                k, v = token.split('=', 1)
                if context:
                    try:
                        args[k] = template.Variable(v).resolve(context)
                    except template.VariableDoesNotExist:
                        args[k] = v
                else:
                    args[k] = v
            else:
                args[token] = True

        return args

    except TypeError:
        raise template.TemplateSyntaxError('Malformed arguments')
dataset/ETHPy150Open feincms/feincms/feincms/utils/templatetags.py/_parse_args/original