code: def format_time(t):
      """Format seconds into a human readable form.
  
      >>> format_time(10.4)  # doctest: +SKIP
      '10.4s'
      >>> format_time(1000.4)  # doctest: +SKIP
      '16min 40.4s'
      """
      m, s = divmod(t, 60)
      h, m = divmod(m, 60)
      if h:
          return f"{h:2.0f}hr {m:2.0f}min {s:4.1f}s"
      elif m:
          return f"{m:2.0f}min {s:4.1f}s"
      else:
          return f"{s:4.1f}s"
  
file_path: dask/dask/diagnostics/progress.py
imports: from __future__ import annotations
  import contextlib
  import sys
  import threading
  import time
  from timeit import default_timer
  from dask.callbacks import Callback
  from dask.utils import _deprecated
label_desc: Use image node_id 1 for calling a global function with example usage: format_time(t) and returns: h, str, m, str, s, str, m, str, s, str, s, str