code: def get_mnist_iterator(rank):
      data_dir = f"data-{rank}"
      if not os.path.isdir(data_dir):
          os.makedirs(data_dir)
      zip_file_path = download(
          "http://data.mxnet.io/mxnet/data/mnist.zip", dirname=data_dir
      )
      with zipfile.ZipFile(zip_file_path) as zf:
          zf.extractall(data_dir)
  
      input_shape = (1, 28, 28)
      batch_size = args.batch_size
  
      train_iter = mx.io.MNISTIter(
          image=f"{data_dir}/train-images-idx3-ubyte",
          label=f"{data_dir}/train-labels-idx1-ubyte",
          input_shape=input_shape,
          batch_size=batch_size,
          shuffle=True,
          flat=False,
          num_parts=hvd.size(),
          part_index=hvd.rank(),
      )
  
      val_iter = mx.io.MNISTIter(
          image=f"{data_dir}/t10k-images-idx3-ubyte",
          label=f"{data_dir}/t10k-labels-idx1-ubyte",
          input_shape=input_shape,
          batch_size=batch_size,
          flat=False,
      )
  
      return train_iter, val_iter
  
file_path: mxnet/example/distributed_training-horovod/gluon_mnist.py
imports: import argparse
  import logging
  import os
  import zipfile
  import time
  import mxnet
  import horovod.mxnet
  from mxnet import autograd, gluon, nd
  from mxnet.test_utils import download
label_desc: Use image node_id 1 for calling a global function with example usage: get_mnist_iterator(rank) and returns: train_iter,  val_iter