code: def test_with_shuffling_buffer(
      synthetic_dataset, reader_factory, data_loader_type
  ):
      with data_loader_type(
          reader_factory(
              synthetic_dataset.url,
              schema_fields=["^id$"],
              workers_count=1,
              shuffle_row_groups=False,
          ),
          shuffling_queue_capacity=51,
      ) as loader:
          ids = [row["id"][0].numpy() for row in loader]
  
          assert len(ids) == len(
              synthetic_dataset.data
          ), "All samples should be returned after reshuffling"
  
          # diff(ids) would return all-'1' for the seqeunce (note that we used shuffle_row_groups=False)
          # We assume we get less then 10% of consequent elements for the sake of the test (this probability is very
          # close to zero)
          assert (
              sum(np.diff(ids) == 1)
              < len(synthetic_dataset.data) / 10.0
          )
  
imports: from decimal import Decimal
  from packaging import version
  import numpy
  import pyarrow
  import pytest
  import torch
  from petastorm import make_reader, TransformSpec, make_batch_reader
  from petastorm.pytorch import _sanitize_pytorch_types, DataLoader, BatchedDataLoader, decimal_friendly_collate, InMemBatchedDataLoader, _load_rows_into_mem
  from petastorm.tests.test_common import TestSchema
label_desc: Use image node_id 12 for calling a global function with example usage: test_with_shuffling_buffer(synthetic_dataset, reader_factory, data_loader_type) without return types