code: def _vad_frame_seq_collate_fn(self, batch):
      """collate batch of audio sig, audio len, tokens, tokens len
      Args:
          batch (Optional[FloatTensor], Optional[LongTensor], LongTensor,
              LongTensor):  A tuple of tuples of signal, signal lengths,
              encoded tokens, and encoded tokens length.  This collate func
              assumes the signals are 1d torch tensors (i.e. mono audio).
              batch size equals to 1.
      """
      slice_length = int(
          self.featurizer.sample_rate * self.window_length_in_sec
      )
      _, audio_lengths, _, tokens_lengths = zip(*batch)
      slice_length = int(min(slice_length, max(audio_lengths)))
      shift = int(
          self.featurizer.sample_rate * self.shift_length_in_sec
      )
      has_audio = audio_lengths[0] is not None
  
      audio_signal, num_slices, tokens, audio_lengths = [], [], [], []
  
      append_len_start = slice_length // 2
      append_len_end = slice_length - slice_length // 2
      for sig, sig_len, tokens_i, _ in batch:
          if self.normalize_audio:
              sig = normalize(sig)
          start = torch.zeros(append_len_start)
          end = torch.zeros(append_len_end)
          sig = torch.cat((start, sig, end))
          sig_len += slice_length
  
          if has_audio:
              slices = torch.div(
                  sig_len - slice_length, shift, rounding_mode="trunc"
              )
              for slice_id in range(slices):
                  start_idx = slice_id * shift
                  end_idx = start_idx + slice_length
                  signal = sig[start_idx:end_idx]
                  audio_signal.append(signal)
  
              num_slices.append(slices)
              tokens.extend([tokens_i] * slices)
              audio_lengths.extend([slice_length] * slices)
  
      if has_audio:
          audio_signal = torch.stack(audio_signal)
          audio_lengths = torch.tensor(audio_lengths)
      else:
          audio_signal, audio_lengths = None, None
  
      tokens = torch.stack(tokens)
      tokens_lengths = torch.tensor(num_slices)
      return audio_signal, audio_lengths, tokens, tokens_lengths
  
imports: import io
  import os
  from typing import Dict, List, Optional, Union
  import torch
  import webdataset
  from nemo.collections.asr.data.audio_to_text import cache_datastore_manifests, expand_sharded_filepaths
  from nemo.collections.asr.parts.preprocessing.features import WaveformFeaturizer
  from nemo.collections.asr.parts.preprocessing.segment import available_formats
  from nemo.collections.common.parts.preprocessing import collections
  from nemo.core.classes import Dataset, IterableDataset
  from nemo.core.neural_types import AudioSignal, LabelsType, LengthsType, NeuralType, RegressionValuesType
  from nemo.utils import logging
label_desc: Use image node_id 6 for calling a global function with example usage: _vad_frame_seq_collate_fn(batch) and returns: audio_signal,  audio_lengths,  tokens,  tokens_lengths