code: def flat_collate_fn(batch):
      elem = batch[0]
      if isinstance(elem, (np.ndarray, int, float, str)):
          return dataloader.default_collate(batch)
      elif isinstance(elem, (list, dict, set)):
          # Don't do anything to list of lists
          return batch
      else:
          raise TypeError(type(elem))
  
imports: import numpy
  from typing import NamedTuple, Mapping, Dict
  from enum import Enum
  from dataclasses import dataclass
  import torch
  import torch.utils.data.dataloader
  from jiant.utils.python.datastructures import ExtendedDataClassMixin, combine_dicts
label_desc: Use image node_id 3 for calling a global function with example usage: flat_collate_fn(batch) and returns: dataloader, batch