def METHOD_NAME(
    example: Dict[str, tf.Tensor], numpy: bool = False
) -> Dict[str, tf.Tensor]:
    """Convert ragged tensors in an example into normal tensors with NaN padding.
    Args:
        example: Dictionary keyed by strings with tensors as values.
        numpy: If `True`, convert values to numpy arrays or Python primitives.
    Returns:
        The same dictionary, but values of type `tf.RaggedTensor` will be converted to
        tensors of type `tf.Tensor` with NaN padding if the ragged dimensions are of
        variable length.
        The output shapes will be the bounding shape of the ragged tensors.
        If `numpy` is `True`, the values will be `numpy.ndarray`s or Python primitives
        depending on their data type and shape.
    See also: keras.utils.sync_to_numpy_or_python_type
    """
    for key in example:
        if isinstance(example[key], tf.RaggedTensor):
            example[key] = example[key].to_tensor(
                default_value=tf.cast(np.nan, example[key].dtype)
            )
    if numpy:
        example = tf_utils.sync_to_numpy_or_python_type(example)
    return example