code: def strdelta(tdelta):
      if isinstance(tdelta, (int, float)):
          tdelta = timedelta(milliseconds=tdelta)
      d = {"D": tdelta.days}
      d["H"], rem = divmod(tdelta.seconds, 3600)
      d["M"], d["S"] = divmod(rem, 60)
      d["f"] = str(tdelta.microseconds)[0:4]
      if d["D"] > 0:
          t = "{D}d {H}h {M}m {S}.{f}s"
      elif d["H"] > 0:
          t = "{H}h {M}m {S}.{f}s"
      elif d["M"] > 0:
          t = "{M}m {S}.{f}s"
      else:
          t = "{S}.{f}s"
      return t.format(**d)
  
imports: import logging
  import time
  from datetime import datetime, timedelta
label_desc: Use image node_id 2 for calling a global function with example usage: strdelta(tdelta) and returns: t