code: def get_petastorm_dataloader(
      dataset: Dataset,
      batch_size: int,
      batch_preprocessor: BatchPreprocessor,
      use_gpu: bool,
      reader_options: ReaderOptions,
  ):
      """get petastorm loader for dataset (with preprocessor)"""
      data_reader = make_batch_reader(
          dataset.parquet_url,
          num_epochs=1,
          reader_pool_type=reader_options.petastorm_reader_pool_type,
      )
      return DataLoader(
          data_reader,
          batch_size=batch_size,
          collate_fn=collate_and_preprocess(
              batch_preprocessor=batch_preprocessor, use_gpu=use_gpu
          ),
      )
  
imports: import logging
  from typing import Dict, List, Optional
  import pytorch_lightning
  import torch
  from petastorm import make_batch_reader
  from petastorm.pytorch import DataLoader, decimal_friendly_collate
  from reagent.core.oss_tensorboard_logger import OssTensorboardLogger
  from reagent.data.spark_utils import get_spark_session
  from reagent.preprocessing.batch_preprocessor import BatchPreprocessor
  from reagent.training import StoppingEpochCallback
  from reagent.training.reagent_lightning_module import has_test_step_override
  from .types import Dataset, ReaderOptions, ResourceOptions
label_desc: Use image node_id 3 for calling a global function with example usage: get_petastorm_dataloader(dataset, batch_size, batch_preprocessor, use_gpu, reader_options) and returns: DataLoader