code: def detection_collate_fn(
      batch: Sequence[DetectionExampleT],
  ) -> DetectionBatchT:
      """
      Collate function used when loading detection datasets using a DataLoader.
  
      This will merge the single samples of a batch to create a minibatch.
      This collate function follows the torchvision format for detection tasks.
      """
  
      # Equivalent to:
      # a = tuple([x[0] for x in batch])
      # b = tuple([x[1] for x in batch])
      # c = tuple([x[2] for x in batch])
      # return a, b, c
  
      return tuple(zip(*batch))
  
file_path: avalanche/avalanche/benchmarks/utils/collate_functions.py
imports: import itertools
  from abc import ABC, abstractmethod
  from collections import defaultdict
  from typing import List, TypeVar, Generic, Sequence, Tuple, Dict, Union, overload
  from typing_extensions import TypeAlias
  import torch
  from torch import Tensor
  from torch.utils.data import default_collate
label_desc: Use image node_id 4 for calling a global function with example usage: detection_collate_fn(batch) and returns: tuple