def parse(args):
    kwargs = {}
    if args:
        if ',' not in args:
            # ensure at least one ','
            args += ','
        for arg in args.split(','):
            arg = arg.strip()
            if arg == '':
                continue
            kw, val = arg.split('=', 1)
            kw = kw.lower()
            kwargs[kw] = val

    return kwargs
dataset/ETHPy150Open kiberpipa/Intranet/intranet/org/templatetags/box.py/parse/original