code: def generate_mnist_dataset(small_mock_mnist_data, tmpdir_factory):
      # Using parquet_files_count to speed up the test
      path = tmpdir_factory.mktemp("data").strpath
      dataset_url = "file://{}".format(path)
      mnist_data_to_petastorm_dataset(
          path,
          dataset_url,
          mnist_data=small_mock_mnist_data,
          spark_master="local[1]",
          parquet_files_count=1,
      )
      return path
  
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 1 for calling a global function with example usage: generate_mnist_dataset(small_mock_mnist_data, tmpdir_factory) and returns: path