code: def test_random_seed(scalar_dataset):
      """Result should be reproducible with the same random seed."""
      for reader_factory in [make_batch_reader, make_reader]:
          results = []
          for _ in range(2):
              # seed has effects on shuffle_rows, shuffle_row_groups and sharding.
              with reader_factory(
                  scalar_dataset.url,
                  reader_pool_type="dummy",
                  shuffle_rows=True,
                  seed=123,
                  shuffle_row_groups=True,
                  cur_shard=0,
                  shard_count=2,
              ) as reader:
                  row_ids_batched = [row.id for row in reader]
              if reader_factory == make_batch_reader:
                  actual_row_ids = list(
                      itertools.chain(*row_ids_batched)
                  )
              else:
                  # No need to unbatch
                  actual_row_ids = row_ids_batched
  
              results.append(actual_row_ids)
          # Shuffled results are expected to be same
          np.testing.assert_equal(results[0], results[1])
  
imports: import glob
  import itertools
  import numpy
  import pandas
  import pytest
  from pyarrow import parquet
  from petastorm import make_batch_reader, make_reader
  from petastorm.arrow_reader_worker import ArrowReaderWorker
  from petastorm.tests.test_common import create_test_scalar_dataset
  from petastorm.transform import TransformSpec
  from petastorm.unischema import UnischemaField
label_desc: Use image node_id 14 for calling a global function with example usage: test_random_seed(scalar_dataset) without return types