code: def _reshape_fn(
      sample_weight_col, feature_columns, label_columns, metadata
  ):
      CUSTOM_SPARSE = constants.CUSTOM_SPARSE
      custom_sparse_to_dense = _custom_sparse_to_dense_fn()
  
      def reshape(row):
          new_row = {}
          if sample_weight_col:
              new_row[sample_weight_col] = getattr(
                  row, sample_weight_col
              )
  
          for col in feature_columns + label_columns:
              v = getattr(row, col)
              intermediate_format = metadata[col]["intermediate_format"]
              if intermediate_format == CUSTOM_SPARSE:
                  reshaped_v = tf.reshape(
                      v, [metadata[col]["max_size"] * 2 + 1]
                  )
                  v = custom_sparse_to_dense(
                      reshaped_v, metadata[col]["shape"]
                  )
  
              new_row[col] = v
          return new_row
  
      return reshape
  
imports: import io
  from packaging import version
  import h5py
  import numpy
  import tensorflow
  from horovod.runner.common.util import codec
  from horovod.spark.common import constants, params
  from horovod.spark.keras import optimizer, remote
label_desc: Use image node_id 12 for calling the TFKerasUtil obj's underlying member method code with example usage: obj._reshape_fn(sample_weight_col, feature_columns, label_columns, metadata) and returns: reshape, new_row