code: def unpack_batch(batch):
      if len(batch) != 2:
          raise ValueError(
              "Invalid batch structure. Expecting `(inputs, labels), records`"
          )
  
      inputs = batch[0][0]
      if len(batch[0]) == 1:
          labels = [None] * len(inputs)
      elif len(batch[0]) == 2:
          labels = batch[0][1]
      else:
          raise ValueError(
              "Invalid batch structure. Expecting `(inputs, Optional[labels]), records`"
          )
  
      records = batch[1]
  
      if not len(inputs) == len(labels) == len(records):
          raise ValueError(
              "Number of inputs, labels and records should be the same"
              f"but got {(len(inputs), len(labels), len(records))}"
          )
  
      return (inputs, labels), records
  
file_path: icevision/icevision/models/utils.py
imports: from icevision.imports import *
  from icevision.utils import *
  from icevision.core import *
  from icevision.data import *
  from icevision.parsers import *
  from icevision.data.dataset import Dataset
label_desc: Use image node_id 9 for calling a global function with example usage: unpack_batch(batch) and returns: inputs,  labels,  records