code: def left_justified_expand_dims_to(x, rank, name=None):
      """Right pads `x` with `rank - rank(x)` ones."""
      with tf.name_scope(name or "left_justified_expand_dims_to"):
          expand_ndims = ps.maximum(rank - ps.rank(x), 0)
          expand_shape = ps.concat(
              [
                  ps.shape(x),
                  ps.ones(shape=[expand_ndims], dtype=tf.int32),
              ],
              axis=0,
          )
          return tf.reshape(x, expand_shape)
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.internal import prefer_static
label_desc: Use image node_id 2 for calling a global function with example usage: left_justified_expand_dims_to(x, rank, name) and returns: tf