import base64


def base64url_decode(data):
    """
    base64-decodes its input, using the modified URL-safe
    alphabet given in RFC 4648.
    """
    return base64.b64decode(bytes(data, encoding='ASCII'),
            altchars='-_')