def test_shuffling_queue(synthetic_dataset):
    """Read data without tensorflow shuffling queue and with it. Check the the order is deterministic within
    unshuffled read and is random with shuffled read"""
    unshuffled_1, _ = _read_from_tf_tensors(synthetic_dataset, 30, shuffling_queue_capacity=0, min_after_dequeue=0,
                                            ngram=None)
    unshuffled_2, _ = _read_from_tf_tensors(synthetic_dataset, 30, shuffling_queue_capacity=0, min_after_dequeue=0,
                                            ngram=None)

    shuffled_1, shuffled_1_row_tensors = \
        _read_from_tf_tensors(synthetic_dataset, 30, shuffling_queue_capacity=10, min_after_dequeue=9, ngram=None)
    shuffled_2, _ = \
        _read_from_tf_tensors(synthetic_dataset, 30, shuffling_queue_capacity=10, min_after_dequeue=9, ngram=None)

    # Make sure we have static shapes and the data matches reference data (important since a different code path
    # is executed within tf_tensors when shuffling is specified
    _assert_all_tensors_have_shape(shuffled_1_row_tensors)
    _assert_expected_rows_data(synthetic_dataset.data, shuffled_1)

    assert [f.id for f in unshuffled_1] == [f.id for f in unshuffled_2]
    assert [f.id for f in unshuffled_1] != [f.id for f in shuffled_2]
    assert [f.id for f in shuffled_1] != [f.id for f in shuffled_2]
Read data without tensorflow shuffling queue and with it. Check the the order is deterministic within
    unshuffled read and is random with shuffled read
petastorm/tests/test_tf_utils.py