code: def make_create_ds_fn(self, train_df, val_df):
      def create_ds(mode):
          if mode == "train":
              dataset = TFDataset.from_dataframe(
                  train_df,
                  feature_cols=["feature"],
                  labels_cols=["label"],
                  batch_size=32,
                  validation_df=val_df,
              )
          elif mode == "predict":
              dataset = TFDataset.from_dataframe(
                  val_df, feature_cols=["feature"], batch_per_thread=32
              )
          elif mode == "evaluate":
              dataset = TFDataset.from_dataframe(
                  val_df,
                  feature_cols=["feature"],
                  labels_cols=["label"],
                  batch_per_thread=32,
              )
          else:
              raise ValueError("unrecognized mode: {}".format(mode))
  
          return dataset
  
      return create_ds
  
imports: import pytest
  from pyspark.ml.linalg import DenseVector
  from zoo.feature.common import ChainedPreprocessing, FeatureSet
  from zoo.feature.image import *
  from test.zoo.pipeline.utils.test_utils import ZooTestCase
  from zoo.pipeline.api.keras.optimizers import Adam
  from zoo.tfpark import TFNet, TFOptimizer
  import tensorflow
  import numpy
  import os
  from zoo.tfpark import KerasModel, TFDataset
label_desc: Use image node_id 20 for calling the TestTFDataset obj's underlying member method code with example usage: obj.make_create_ds_fn(train_df, val_df) and returns: create_ds, dataset