code: def _merge_instances(
      labels: tf.Tensor, padding_mask: tf.Tensor
  ) -> tf.Tensor:
      """Combine a batch of padded instance labels into a single-example label."""
      tf.debugging.assert_equal(
          tf.shape(labels), tf.shape(padding_mask)
      )
      labels = tf.reshape(labels, [-1])
      padding_mask = tf.reshape(padding_mask, [-1])
      return labels[padding_mask]
  
file_path: scenic/scenic/projects/owl_vit/preprocessing/mosaic.py
imports: import dataclasses
  from typing import Tuple
  from scenic.projects.owl_vit.preprocessing import image_ops
  from scenic.projects.owl_vit.preprocessing import modalities
  import tensorflow
label_desc: Use image node_id 3 for calling a global function with example usage: _merge_instances(labels, padding_mask) and returns: labels