code: def _prepare_pad_values(pad_values, tensors, dtype):
      """Prepares a list of paddings."""
      if pad_values is not None:
          if isinstance(pad_values, (list, tuple)):
              # Shapes compatible with [batch_shape_i, 1]
              pad_values = [
                  tf.expand_dims(
                      tf.convert_to_tensor(
                          pad_value, dtype=dtype, name="pad_values"
                      ),
                      axis=-1,
                  )
                  for pad_value in pad_values
              ]
          else:
              pad_values = len(tensors) * [
                  tf.constant(
                      pad_values, dtype=dtype, name="pad_values"
                  )
              ]
      else:
          # Use final value for padding if `pad_values` are not supplied
          pad_values = [t[..., -1:] for t in tensors]
      return pad_values
  
imports: import tensorflow.compat.v2
  from tf_quant_finance.datetime import date_tensor
label_desc: Use image node_id 3 for calling a global function with example usage: _prepare_pad_values(pad_values, tensors, dtype) and returns: pad_values