def decrypt(*args, **kwargs):
    """ Decrypts legacy or spec-compliant JOSE token.
    First attempts to decrypt the token in a legacy mode
    (https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-19).
    If it is not a valid legacy token then attempts to decrypt it in a
    spec-compliant way (http://tools.ietf.org/html/rfc7519)
    """
    try:
        return legacy_decrypt(*args, **kwargs)
    except (Error, __HOLE__) as e:
        return spec_compliant_decrypt(*args, **kwargs)
dataset/ETHPy150Open Demonware/jose/jose.py/decrypt