code: def create_imageset_input_fn(self):
      def input_fn(mode):
          import os
  
          resource_path = os.path.join(
              os.path.split(__file__)[0], "../resources"
          )
          if mode == tf.estimator.ModeKeys.TRAIN:
              image_folder = os.path.join(resource_path, "cat_dog")
              image_set = ImageSet.read(
                  image_folder,
                  with_label=True,
                  sc=self.sc,
                  one_based_label=False,
              )
              transformer = ChainedPreprocessing(
                  [
                      ImageResize(256, 256),
                      ImageRandomCrop(224, 224, True),
                      ImageMatToTensor(format="NHWC"),
                      ImageSetToSample(
                          input_keys=["imageTensor"],
                          target_keys=["label"],
                      ),
                  ]
              )
              image_set = image_set.transform(transformer)
              dataset = TFDataset.from_image_set(
                  image_set,
                  image=(tf.float32, [224, 224, 3]),
                  label=(tf.int32, [1]),
                  batch_size=8,
              )
          elif mode == tf.estimator.ModeKeys.EVAL:
              image_folder = os.path.join(resource_path, "cat_dog")
              image_set = ImageSet.read(
                  image_folder,
                  with_label=True,
                  sc=self.sc,
                  one_based_label=False,
              )
              transformer = ChainedPreprocessing(
                  [
                      ImageResize(256, 256),
                      ImageRandomCrop(224, 224, True),
                      ImageMatToTensor(format="NHWC"),
                      ImageSetToSample(
                          input_keys=["imageTensor"],
                          target_keys=["label"],
                      ),
                  ]
              )
              image_set = image_set.transform(transformer)
              dataset = TFDataset.from_image_set(
                  image_set,
                  image=(tf.float32, [224, 224, 3]),
                  label=(tf.int32, [1]),
                  batch_per_thread=8,
              )
          else:
              image_folder = os.path.join(resource_path, "cat_dog/*/*")
              image_set = ImageSet.read(
                  image_folder,
                  with_label=False,
                  sc=self.sc,
                  one_based_label=False,
              )
              transformer = ChainedPreprocessing(
                  [
                      ImageResize(256, 256),
                      ImageRandomCrop(224, 224, True),
                      ImageMatToTensor(format="NHWC"),
                      ImageSetToSample(input_keys=["imageTensor"]),
                  ]
              )
              image_set = image_set.transform(transformer)
              dataset = TFDataset.from_image_set(
                  image_set,
                  image=(tf.float32, [224, 224, 3]),
                  batch_per_thread=8,
              )
  
          return dataset
  
      return input_fn
  
imports: import pytest
  from test.zoo.pipeline.utils.test_utils import ZooTestCase
  import tensorflow
  from zoo.feature.common import ChainedPreprocessing, FeatureSet
  from zoo.feature.image import *
  from zoo.tfpark import TFDataset, TFEstimator
  from zoo.tfpark import ZooOptimizer
label_desc: Use image node_id 9 for calling the TestTFParkEstimator obj's underlying member method code with example usage: obj.create_imageset_input_fn() and returns: input_fn, dataset