code: def _human_readable_size(size, decimal_places=3):
      for unit in ["B", "KiB", "MiB", "GiB", "TiB"]:
          if size < 1024.0:
              break
          size /= 1024.0
      return f"{size:.{decimal_places}f}{unit}"
  
file_path: airflow/tests/test_utils/perf/perf_kit/memory.py
imports: from __future__ import annotations
  import gc
  import os
  from contextlib import contextmanager
  import psutil
label_desc: Use image node_id 2 for calling a global function with example usage: _human_readable_size(size, decimal_places) and returns: size, unit