code: def _feature_collate_fn(batch):
      """collate batch of feat sig, feat len, labels, labels len, assuming all features have the same shape.
      Args:
          batch (FloatTensor, LongTensor, LongTensor, LongTensor):  A tuple of tuples of feature, feature lengths,
                 encoded labels, and encoded labels length.
      """
      packed_batch = list(zip(*batch))
      if len(packed_batch) == 5:
          _, feat_lengths, _, labels_lengths, sample_ids = packed_batch
      elif len(packed_batch) == 4:
          sample_ids = None
          _, feat_lengths, _, labels_lengths = packed_batch
      else:
          raise ValueError("Expects 4 or 5 tensors in the batch!")
  
      features, labels = [], []
      for b in batch:
          feat_i, labels_i = b[0], b[2]
          features.append(feat_i)
          labels.append(labels_i)
  
      features = torch.stack(features)
      feat_lengths = torch.stack(feat_lengths)
  
      labels = torch.stack(labels)
      labels_lengths = torch.stack(labels_lengths)
  
      if sample_ids is None:
          return features, feat_lengths, labels, labels_lengths
      else:
          sample_ids = torch.tensor(sample_ids, dtype=torch.int32)
          return (
              features,
              feat_lengths,
              labels,
              labels_lengths,
              sample_ids,
          )
  
imports: from typing import Dict, List, Optional
  import torch
  from nemo.collections.asr.parts.preprocessing.feature_loader import ExternalFeatureLoader
  from nemo.collections.common.parts.preprocessing import collections
  from nemo.core.classes import Dataset
  from nemo.core.neural_types import AcousticEncodedRepresentation, LabelsType, LengthsType, NeuralType
  from nemo.utils import logging
label_desc: Use image node_id 1 for calling a global function with example usage: _feature_collate_fn(batch) and returns: features,  feat_lengths,  labels,  labels_lengths, features,  feat_lengths,  labels,  labels_lengths,  sample_ids