code: def pad(
      key,
      max_length=100,
      pad_char="#",
  ):
      """Pads a key string to a fixed length.
  
      We have to iteratively find an integer eqaul to key_length tensor to be able
      to multiply it by pad_char and make a proper pad.
  
      Args:
        key: The original key, usually a path-like string.
        max_length: Length of the desired key.
        pad_char: Character to be used for padding.
  
      Returns:
        Padded key of the required length.
      """
      padding = ""
      # Transform the key into the basename of the file without the extension.
      key = tf.strings.join(
          [
              tf.strings.split(key, sep="/")[-2],
              "/",
              tf.strings.split(key, sep="/")[-1],
          ]
      )
      key = tf.strings.regex_replace(key, ".png", "")
      for padding_size in range(1, max_length):
          if tf.math.equal(
              padding_size, max_length - tf.strings.length(key)
          ):
              padding = padding_size * pad_char
      padded_key = tf.strings.join([padding, key])
      return padded_key
  
file_path: scenic/scenic/projects/tasseo/dataset_utils.py
imports: from absl import logging
  import jax
  import numpy
  import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: pad(key, max_length, pad_char) and returns: padded_key