code: def get_spec(allow_tuple=True, allow_list=True):
      """
      :param allow_tuple: boolean, if the model accepts a tuple as input. Default: True
      :param allow_list: boolean, if the model accepts a list as input. Default: True
      :return:
      """
  
      def _get_spec(data):
          data = check_type_and_convert(data, allow_tuple, allow_list)
          feature_spec = [
              (feat.dtype, feat.shape[1:]) for feat in data["x"]
          ]
          if "y" in data:
              label_spec = [
                  (label.dtype, label.shape[1:]) for label in data["y"]
              ]
          else:
              label_spec = None
          return feature_spec, label_spec
  
      return _get_spec
  
imports: from bigdl.dllib.utils.file_utils import get_file_list, callZooFunc
  from bigdl.dllib.utils.utils import convert_row_to_numpy
  from bigdl.dllib.utils.common import *
  from bigdl.dllib.utils.log4Error import *
  import pyspark.sql.functions
  from typing import TYPE_CHECKING, Dict, List, Optional, Type, Union
  from numpy import float32, int32
label_desc: Use image node_id 4 for calling a global function with example usage: get_spec(allow_tuple, allow_list) and returns: _get_spec, feature_spec,  label_spec