def parse_description_string(desc, authmod=None):
    base, opts = None, None

    for rpart in desc.split(':'):
        part = rpart.strip(' []')
        if 'authmod=' in part:
            kvs = dict(v.strip().split('=', 1) for v in part.split(';'))
            if not authmod or kvs.get('authmod') == authmod:
                base = kvs
        elif part.startswith('?'):
            opts = parse_url_args(part)

    return base, opts
dataset/ETHPy150Open arkadini/twimp/twimp/auth/base.py/parse_description_string/original