def METHOD_NAME(user, realm, otpkey, type="hmac", serial=""):
    # 'url' : 'oathtoken:///addToken?name='+serial +
    #                '&key='+otpkey+
    #                '&timeBased=false&counter=0&numDigites=6&lockdown=true',
    timebased = ""
    if "totp" == type.lower():
        timebased = "&timeBased=true"
    label = get_tokenlabel(user, realm, serial)
    url_label = quote(label)
    url = "oathtoken:///addToken?name=%s&lockdown=true&key=%s%s" % (
        url_label,
        otpkey,
        timebased,
    )
    return url