code: def timestampify(
      start: tf.Tensor,
      end: tf.Tensor,
      duration: tf.Tensor,
      abs_time_token: bool,
      num_bins: int,
      vocabulary_size: int,
      time_format: str,
      t: int = 1000000,
  ):
      """Tokenizes timestamps.
  
      Args:
        start: Start times of the events.
        end: End times of the events.
        duration: Duration of the video.
        abs_time_token: Whether to use absolute (vs relative) time tokens.
        num_bins: Number of quantization bins for time tokens.
        vocabulary_size: Number of text tokens.
        time_format: st for start-end or cd for center-duration.
        t: FPS * 1000000
  
      Returns:
        Tensor of start+end time tokens for each event.
      """
  
      if time_format == "cd":
          timestamp = tf.stack(
              [(start + end) // 2, end - start], axis=1
          )
      else:
          timestamp = tf.stack([start, end], axis=1)
      timestamp = tf.minimum(timestamp, duration)
  
      if not abs_time_token:  # relative time token
          max_offset = tf.cast(num_bins - 1, tf.float64)
          rel_timestamp = tf.math.divide(timestamp, duration)
          timestamp_token = tf.math.add(
              tf.math.multiply(rel_timestamp, max_offset),
              vocabulary_size,
          )
          timestamp_token = tf.cast(timestamp_token, tf.int32)
  
      else:  # absolute time token
          timestamp_token = tf.math.add(
              tf.cast(timestamp / t, tf.int32), vocabulary_size
          )
  
      return timestamp_token
  
imports: import functools
  from typing import Any, Mapping, Optional, Union
  from dmvr import builders
  from dmvr import processors
  from dmvr import tokenizers
  import gin
  from t5.data.preprocessors import DenoiseInputsFn
  from t5.data.preprocessors import DenoiseNoiseMaskFn
  from t5.data.preprocessors import DenoiseTargetsFn
  from t5.data.preprocessors import random_spans_noise_mask
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: timestampify(start, end, duration, abs_time_token, num_bins, vocabulary_size, time_format, t) and returns: timestamp_token