code: def summary(
      self: DataBlock,
      source,  # The data source
      bs: int = 4,  # The batch size
      show_batch: bool = False,  # Call `show_batch` after the summary
      **kwargs,  # Additional keyword arguments to `show_batch`
  ):
      "Steps through the transform pipeline for one batch, and optionally calls `show_batch(**kwargs)` on the transient `Dataloaders`."
      print(f"Setting-up type transforms pipelines")
      dsets = self.datasets(source, verbose=True)
      print("\nBuilding one sample")
      for tl in dsets.train.tls:
          _apply_pipeline(tl.tfms, get_first(dsets.train.items))
      print(f"\nFinal sample: {dsets.train[0]}\n\n")
  
      dls = self.dataloaders(source, bs=bs, verbose=True)
      print("\nBuilding one batch")
      if (
          len([f for f in dls.train.after_item.fs if f.name != "noop"])
          != 0
      ):
          print("Applying item_tfms to the first sample:")
          s = [_apply_pipeline(dls.train.after_item, dsets.train[0])]
          print(f"\nAdding the next {bs-1} samples")
          s += [
              dls.train.after_item(dsets.train[i]) for i in range(1, bs)
          ]
      else:
          print("No item_tfms to apply")
          s = [dls.train.after_item(dsets.train[i]) for i in range(bs)]
  
      if (
          len(
              [f for f in dls.train.before_batch.fs if f.name != "noop"]
          )
          != 0
      ):
          print("\nApplying before_batch to the list of samples")
          s = _apply_pipeline(dls.train.before_batch, s)
      else:
          print("\nNo before_batch transform to apply")
  
      print("\nCollating items in a batch")
      try:
          b = dls.train.create_batch(s)
          b = retain_types(b, s[0] if is_listy(s) else s)
      except Exception as e:
          print(
              "Error! It's not possible to collate your items in a batch"
          )
          why = _find_fail_collate(s)
          print(
              "Make sure all parts of your samples are tensors of the same size"
              if why is None
              else why
          )
          raise e
  
      if (
          len([f for f in dls.train.after_batch.fs if f.name != "noop"])
          != 0
      ):
          print("\nApplying batch_tfms to the batch built")
          b = to_device(b, dls.device)
          b = _apply_pipeline(dls.train.after_batch, b)
      else:
          print("\nNo batch_tfms to apply")
  
      if show_batch:
          dls.show_batch(**kwargs)
  
imports: from __future__ import annotations
  from ..torch_basics import *
  from .core import *
  from .load import *
  from .external import *
  from .transforms import *
  from inspect import isfunction, ismethod
  from .load import _collate_types
label_desc: Use image node_id 10 for calling a global function with example usage: summary(source, bs, show_batch) without return types