code: def _check_simple_reader(reader, expected_data):
      # Read a bunch of entries from the dataset and compare the data to reference
      expected_field_names = expected_data[0].keys()
      count = 0
      for row in reader:
          actual = row._asdict()
  
          # Compare value of each entry in the batch
          for i, id_value in enumerate(actual["id"]):
              expected = next(
                  d for d in expected_data if d["id"] == id_value
              )
              for field in expected_field_names:
                  expected_value = expected[field]
                  actual_value = actual[field][i, ...]
                  np.testing.assert_equal(actual_value, expected_value)
  
          count += len(actual["id"])
  
      assert count == len(expected_data)
  
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 1 for calling a global function with example usage: _check_simple_reader(reader, expected_data) without return types