code: def _dataset_worker_fn(urls, dataset_fn, batch_sampler_fn):
      """Function to generate datasets and batch sampler for each worker."""
      global _manager, _dataset
      dataset = dataset_fn(urls)
      batch_sampler = batch_sampler_fn(dataset)
      if _manager:
          dataset = _manager.list(zip(*dataset._data))
      _dataset = dataset
      return dataset, batch_sampler
  
imports: import io
  import os
  import gc
  import glob
  import pickle
  import warnings
  import multiprocessing
  from functools import partial
  import numpy
  from mxnet import context, npx
  from mxnet.gluon.data import ArrayDataset, SimpleDataset
  from mxnet.gluon.data.dataloader import ForkingPickler, _as_in_context, default_mp_batchify_fn, default_batchify_fn
label_desc: Use image node_id 2 for calling a global function with example usage: _dataset_worker_fn(urls, dataset_fn, batch_sampler_fn) and returns: dataset,  batch_sampler