code: def _format_timedelta(timedelta: datetime.timedelta) -> str:
      """
      Return hh:mm:ss, or mm:ss if the amount of hours is zero.
      """
      result = f"{timedelta}".split(".")[0]
      if result.startswith("0:"):
          result = result[2:]
      return result
  
imports: from __future__ import annotations
  import datetime
  import time
  from abc import ABCMeta, abstractmethod
  from typing import TYPE_CHECKING
  from prompt_toolkit.formatted_text import HTML, AnyFormattedText, StyleAndTextTuples, to_formatted_text
  from prompt_toolkit.formatted_text.utils import fragment_list_width
  from prompt_toolkit.layout.dimension import AnyDimension, D
  from prompt_toolkit.layout.utils import explode_text_fragments
  from prompt_toolkit.utils import get_cwidth
label_desc: Use image node_id 1 for calling a global function with example usage: _format_timedelta(timedelta) and returns: result