code: def get_pp_random_sample(
      seed: Optional[int] = None,
  ) -> Callable[[tf.Tensor], tf.Tensor]:
      """PP op to select the first text out of many."""
  
      def _random_sample(
          sequence: tf.Tensor,  # Any shape
      ) -> tf.Tensor:  # Shape: ()
          sequence = tf.reshape(sequence, (-1,))
          shape = tf.shape(sequence)
          index = tf.random.uniform(
              (), maxval=shape[0], dtype=tf.int32, seed=seed
          )
          return sequence[index]
  
      return _random_sample
  
file_path: scenic/scenic/projects/lang4video/pp_ops.py
imports: from collections.abc import Callable
  import functools
  from typing import Optional
  from dmvr import processors
  from dmvr import tokenizers
  import ml_collections
  from scenic.dataset_lib.big_transfer.preprocessing import utils
  from scenic.dataset_lib.big_transfer.registry import Registry
  from scenic.projects.lang4video import util
  import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: get_pp_random_sample(seed) and returns: _random_sample, sequence