def METHOD_NAME(self, db, patron):
    """Look up for a SAML token.
    :param db: Database session
    :type db: sqlalchemy.orm.session.Session
    :param patron: Patron object
    :type patron: core.model.patron.Patron
    :return: SAML subject (if any)
    :rtype: Optional[api.saml.metadata.Subject]
    """
    self._logger.debug("Started looking up for a SAML token")
    from api.authenticator import BaseSAMLAuthenticationProvider
    credential = Credential.lookup_by_patron(
        db,
        BaseSAMLAuthenticationProvider.TOKEN_DATA_SOURCE_NAME,
        BaseSAMLAuthenticationProvider.TOKEN_TYPE,
        patron,
        allow_persistent_token=False,
        auto_create_datasource=True,
    )
    self._logger.debug(
        "Finished looking up for a SAML token: {0}".format(credential)
    )
    return credential