code: def partition_get_data_label(
      partition_data, allow_tuple=True, allow_list=True, has_label=True
  ):
      """
      :param partition_data: The data partition from Spark RDD, which should be a list of records.
      :param allow_tuple: Boolean. Whether the model accepts a tuple as input. Default is True.
      :param allow_list: Boolean. Whether the model accepts a list as input. Default is True.
      :param has_label: Boolean. Whether the data partition contains labels.
      :return: Concatenated data for the data partition.
      """
      data_list = [data["x"] for data in partition_data]
      label_list = [data["y"] for data in partition_data]
  
      data = _convert_list_tuple(
          combine(data_list),
          allow_tuple=allow_tuple,
          allow_list=allow_list,
      )
      if has_label:
          label = _convert_list_tuple(
              combine(label_list),
              allow_tuple=allow_tuple,
              allow_list=allow_list,
          )
      else:
          label = None
  
      return data, label
  
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 7 for calling a global function with example usage: partition_get_data_label(partition_data, allow_tuple, allow_list, has_label) and returns: data,  label