code: def _non_zipping_check(
      batch_data: Mapping | Iterable,
      detach: bool,
      pad: bool,
      fill_value,
  ):
      """
      Utility function based on `decollate_batch`, to identify the largest batch size from the collated data.
      returns batch_size, the list of non-iterable items, and the dictionary or list with their items decollated.
  
      See `decollate_batch` for more details.
      """
      _deco: Mapping | Sequence
      if isinstance(batch_data, Mapping):
          _deco = {
              key: decollate_batch(
                  batch_data[key],
                  detach,
                  pad=pad,
                  fill_value=fill_value,
              )
              for key in batch_data
          }
      elif isinstance(batch_data, Iterable):
          _deco = [
              decollate_batch(b, detach, pad=pad, fill_value=fill_value)
              for b in batch_data
          ]
      else:
          raise NotImplementedError(
              f"Unable to de-collate: {batch_data}, type: {type(batch_data)}."
          )
      batch_size, non_iterable = 0, []
      for k, v in (
          _deco.items()
          if isinstance(_deco, Mapping)
          else enumerate(_deco)
      ):
          if (
              not isinstance(v, Iterable)
              or isinstance(v, (str, bytes))
              or (isinstance(v, torch.Tensor) and v.ndim == 0)
          ):
              # Not running the usual list decollate here:
              # don't decollate ['test', 'test'] into [['t', 't'], ['e', 'e'], ['s', 's'], ['t', 't']]
              # torch.tensor(0) is iterable but iter(torch.tensor(0)) raises TypeError: iteration over a 0-d tensor
              non_iterable.append(k)
          elif isinstance(v, Sized):
              batch_size = max(batch_size, len(v))
      return batch_size, non_iterable, _deco
  
imports: from __future__ import annotations
  import hashlib
  import json
  import logging
  import math
  import os
  import pickle
  import sys
  from collections import abc, defaultdict
  from collections.abc import Generator, Iterable, Mapping, Sequence, Sized
  from copy import deepcopy
  from functools import reduce
  from itertools import product, starmap, zip_longest
  from pathlib import PurePath
  from typing import Any
  import numpy
  import torch
  from torch.utils.data._utils.collate import default_collate
  from monai import config
  from monai.config.type_definitions import NdarrayOrTensor, NdarrayTensor, PathLike
  from monai.data.meta_obj import MetaObj
  from monai.utils import MAX_SEED, BlendMode, Method, NumpyPadMode, TraceKeys, convert_data_type, convert_to_dst_type, ensure_tuple, ensure_tuple_rep, ensure_tuple_size, fall_back_tuple, first, get_equivalent_dtype, issequenceiterable, look_up_option, optional_import, pytorch_after
label_desc: Use image node_id 12 for calling a global function with example usage: _non_zipping_check(batch_data, detach, pad, fill_value) and returns: batch_size,  non_iterable,  _deco