code: def test_read_mnist_dataset(generate_mnist_dataset):
      # Verify both datasets via a reader
      for dset in SMALL_MOCK_IMAGE_COUNT.keys():
          with make_reader(
              "file://{}/{}".format(generate_mnist_dataset, dset),
              reader_pool_type="dummy",
              num_epochs=1,
          ) as reader:
              assert (
                  sum(1 for _ in reader) == SMALL_MOCK_IMAGE_COUNT[dset]
              )
  
file_path: petastorm/examples/mnist/tests/test_pytorch_mnist.py
imports: import logging
  import os
  import unittest
  import pyarrow
  import torch
  import pytest
  import examples.mnist.pytorch_example
  from examples.mnist.generate_petastorm_mnist import mnist_data_to_petastorm_dataset, download_mnist_data
  from examples.mnist.tests.conftest import SMALL_MOCK_IMAGE_COUNT
  from petastorm import make_reader, TransformSpec
label_desc: Use image node_id 5 for calling a global function with example usage: test_read_mnist_dataset(generate_mnist_dataset) without return types