def delete_from_matching_blacklist(db, entity):
    """Remove an blacklisted entity from the registry.

    This function removes the given blacklisted entity from the registry.
    It checks first whether the excluded entity is already on the registry.
    When it is found, the entity is removed. Otherwise, it will raise
    a 'NotFoundError'.

    :param db: database manager
    :param entity: blacklisted entity to remove

    :raises NotFoundError: raised when the blacklisted entity does not exist
        in the registry.
    """
    with db.connect() as session:
        mb = session.query(MatchingBlacklist).\
            filter(MatchingBlacklist.excluded == entity).first()

        if not mb:
            raise NotFoundError(entity=entity)

        delete_from_matching_blacklist_db(session, mb)
Remove an blacklisted entity from the registry.

    This function removes the given blacklisted entity from the registry.
    It checks first whether the excluded entity is already on the registry.
    When it is found, the entity is removed. Otherwise, it will raise
    a 'NotFoundError'.

    :param db: database manager
    :param entity: blacklisted entity to remove

    :raises NotFoundError: raised when the blacklisted entity does not exist
        in the registry.