code: def humanize_time_delta(sec):
      """Humanize timedelta given in seconds
  
      Args:
          sec (float): time difference in seconds. Must be positive.
  
      Returns:
          str - time difference as a readable string
  
      Example:
  
      .. code-block:: python
  
          print(humanize_time_delta(1))                                   # 1 second
          print(humanize_time_delta(60 + 1))                              # 1 minute 1 second
          print(humanize_time_delta(87.6))                                # 1 minute 27 seconds
          print(humanize_time_delta(0.01))                                # 0.01 seconds
          print(humanize_time_delta(60 * 60 + 1))                         # 1 hour 1 second
          print(humanize_time_delta(60 * 60 * 24 + 1))                    # 1 day 1 second
          print(humanize_time_delta(60 * 60 * 24 + 60 * 2 + 60*60*9 + 3)) # 1 day 9 hours 2 minutes 3 seconds
      """
      if sec < 0:
          logger.warn("humanize_time_delta() obtains negative seconds!")
          return "{:.3g} seconds".format(sec)
      if sec == 0:
          return "0 second"
      time = datetime(2000, 1, 1) + timedelta(seconds=int(sec))
      units = ["day", "hour", "minute", "second"]
      vals = [int(sec // 86400), time.hour, time.minute, time.second]
      if sec < 60:
          vals[-1] = sec
  
      def _format(v, u):
          return "{:.3g} {}{}".format(v, u, "s" if v > 1 else "")
  
      ans = []
      for v, u in zip(vals, units):
          if v > 0:
              ans.append(_format(v, u))
      return " ".join(ans)
  
file_path: tensorpack/tensorpack/utils/utils.py
imports: import inspect
  import numpy
  import re
  import os
  import sys
  from contextlib import contextmanager
  from datetime import datetime, timedelta
  from tqdm import tqdm
  from .None import logger
  from .concurrency import subproc_call
label_desc: Use image node_id 1 for calling a global function with example usage: humanize_time_delta(sec) and returns: str, str, str, str