code: def partition_refs_to_creator(partition_refs, shuffle=False):
      def data_creator(config, kv):
          import mxnet as mx
  
          assert (
              "batch_size" in config
          ), "batch_size must be set in config"
          data, label = ray_partitions_get_data_label(
              ray.get(partition_refs),
              allow_tuple=False,
              allow_list=False,
          )
  
          train_data_iter = mx.io.NDArrayIter(
              data=data,
              label=label,
              batch_size=config["batch_size"],
              shuffle=shuffle,
          )
          if "train_resize_batch_num" in config:
              train_data_iter = mx.io.ResizeIter(
                  train_data_iter, config["train_resize_batch_num"]
              )
          return train_data_iter
  
      return data_creator
  
imports: import os
  import types
  import itertools
  import subprocess
  import ray
  from dmlc_tracker.tracker import get_host_ip
  from zoo.orca.data.utils import ray_partitions_get_data_label, process_spark_xshards
  from zoo.ray import RayContext
  from zoo.orca.learn.mxnet.mxnet_runner import MXNetRunner
  from zoo.orca.learn.mxnet.utils import find_free_port
  from zoo.orca.learn.ray_estimator import Estimator
label_desc: Use image node_id 1 for calling a global function with example usage: partition_refs_to_creator(partition_refs, shuffle) and returns: data_creator, train_data_iter