def compare_equal(compare_data):  # pylint: disable=redefined-outer-name
    """
    Returns a function which checks that a given data is equal to the stored reference.
    """
    return lambda data, tag=None: compare_data(lambda x, y: x == y, data, tag)