code: def get_identity_transform(n_translate, n_rotate, n_parts):
      """Generate the identity transformation as translation and rotation.
  
      Args:
        n_translate: int, the dimension of translation.
        n_rotate: int, the dimension of rotation.
        n_parts: int, the number of parts.
  
      Returns:
        transform: [1, 1, n_parts, n_translate + n_rotate], identity transformation.
      """
      translation = tf.zeros(n_translate)
      if n_rotate == 2:
          rotation = tf.convert_to_tensor((1.0, 0.0), dtype=tf.float32)
      elif n_rotate == 6:
          rotation = tf.convert_to_tensor(
              (
                  1.0,
                  0.0,
                  0.0,
                  1.0,
                  0.0,
                  0.0,
              ),
              dtype=tf.float32,
          )
      else:
          raise ValueError("n_rotate should be either 6 or 2.")
      transform = tf.concat([translation, rotation], axis=-1)
      return tf.tile(
          tf.reshape(transform, [1, 1, 1, n_translate + n_rotate]),
          [1, 1, n_parts, 1],
      )
  
file_path: graphics/tensorflow_graphics/projects/nasa/lib/model_utils.py
imports: import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling a global function with example usage: get_identity_transform(n_translate, n_rotate, n_parts) and returns: tf