code: def tsdata_to_data_creator(tf_data, shuffle=True):
      def data_creator(config, batch_size):
          return tf_data.to_tf_dataset(
              shuffle=shuffle, batch_size=batch_size
          )
  
      return data_creator
  
file_path: BigDL/python/chronos/src/bigdl/chronos/forecaster/tf/utils.py
imports: import tensorflow
  import numpy
  import math
  import warnings
label_desc: Use image node_id 2 for calling a global function with example usage: tsdata_to_data_creator(tf_data, shuffle) and returns: data_creator, tf_data