code: def add_embeddings(
      parser_builder: builders.BaseParserBuilder,
      sampler_builder: builders.SamplerBuilder,
      input_feature_lists_name: str,
      output_feature_lists_name: str,
      num_frames: int,
      features_dim: int,
      sync_random_state: bool,
      output_raw_timestamp_name: str,
      output_raw_duration_name: str,
      is_training: bool,
      output_raw_string_name: str,
      p: float,
      output_feature_name: str = builders.TEXT_INDICES_FEATURE_NAME,
      t: int = 1000000,  # 1FPS
      preserve: bool = True,
      asr_input: bool = False,
      max_segments: int = 0,
  ):
      """Add visual features [num_frames, 768]."""
  
      if not isinstance(
          parser_builder, builders.SequenceExampleParserBuilder
      ):
          raise ValueError(
              "add_embeddings only supports tf.SequenceExample."
          )
  
      parser_builder.parse_feature(
          feature_name=input_feature_lists_name,
          feature_type=tf.io.FixedLenSequenceFeature(
              [features_dim], dtype=tf.float32
          ),
          output_name=output_feature_lists_name,
      )
  
      # Moved from the decoder builder as these are used for temporal cropping.
      sampler_builder.add_fn(
          fn=tf.sparse.to_dense,
          feature_name=output_raw_string_name,
          fn_name=f"{output_feature_name}_sparse_to_dense",
      )
      if output_raw_timestamp_name:
          sampler_builder.add_fn(
              fn=tf.sparse.to_dense,
              feature_name=output_raw_timestamp_name + "_start",
              fn_name=f"{output_raw_timestamp_name}_start_sparse_to_dense",
          )
          sampler_builder.add_fn(
              fn=tf.sparse.to_dense,
              feature_name=output_raw_timestamp_name + "_end",
              fn_name=f"{output_raw_timestamp_name}_end_sparse_to_dense",
          )
          sampler_builder.add_fn(
              fn=tf.sparse.to_dense,
              feature_name=output_raw_duration_name,
              fn_name=f"{output_raw_duration_name}_sparse_to_dense",
          )
  
      if asr_input:
          sampler_builder.add_fn(
              fn=tf.sparse.to_dense,
              feature_name="asr_string",
              fn_name="asr_string_sparse_to_dense",
          )
          if output_raw_timestamp_name:
              sampler_builder.add_fn(
                  fn=tf.sparse.to_dense,
                  feature_name="asr_start",
                  fn_name="asr_start_sparse_to_dense",
              )
              sampler_builder.add_fn(
                  fn=tf.sparse.to_dense,
                  feature_name="asr_end",
                  fn_name="asr_end_sparse_to_dense",
              )
  
      if output_raw_timestamp_name:
          sampler_builder.add_fn(
              fn=lambda x, s=None: sample_equal_sequence(  # pylint: disable=g-long-lambda
                  x,
                  num_frames,
                  is_training=is_training,
                  output_feature_lists_name=output_feature_lists_name,
                  output_raw_timestamp_name=output_raw_timestamp_name,
                  output_raw_duration_name=output_raw_duration_name,
                  output_raw_string_name=output_raw_string_name,
                  p=p,
                  t=t,
                  preserve=preserve,
                  asr_input=asr_input,
                  max_segments=max_segments,
              ),
              fn_name=f"{output_feature_lists_name}_sample",
              # Use state to keep coherence between modalities if requested.
              stateful=sync_random_state,
          )
      else:
          sampler_builder.add_fn(
              fn=functools.partial(
                  processors.sample_or_pad_non_sorted_sequence,  # pylint: disable=g-long-lambda
                  max_num_steps=num_frames,
                  pad_value=0,
                  random=False,
              ),
              feature_name=output_feature_lists_name,
              fn_name="pad_features",
          )
  
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 10 for calling a global function with example usage: add_embeddings(parser_builder, sampler_builder, input_feature_lists_name, output_feature_lists_name, num_frames, features_dim, sync_random_state, output_raw_timestamp_name, output_raw_duration_name, is_training, output_raw_string_name, p, output_feature_name, t, preserve, asr_input, max_segments) without return types