code: def decrypt(*args, **kwargs):
      
      try:
          return legacy_decrypt(*args, **kwargs)
      except (NotYetValid, Expired) as e:
          # these should be raised immediately.
          # The token has been decrypted successfully to get to here.
          # decrypting using `legacy_decrypt` will not help things.
          raise e
      except (Error, ValueError) as e:
          return spec_compliant_decrypt(*args, **kwargs)
docs: 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)