code: def timedelta_to_string(timedelta):
      """
      Utility that converts a pandas.Timedelta to a string representation
      compatible with pandas.Timedelta constructor format
  
      Parameters
      ----------
      timedelta: pd.Timedelta
  
      Returns
      -------
      string
          string representation of 'timedelta'
      """
      c = timedelta.components
      format = ""
      if c.days != 0:
          format += "%dD" % c.days
      if c.hours > 0:
          format += "%dh" % c.hours
      if c.minutes > 0:
          format += "%dm" % c.minutes
      if c.seconds > 0:
          format += "%ds" % c.seconds
      if c.milliseconds > 0:
          format += "%dms" % c.milliseconds
      if c.microseconds > 0:
          format += "%dus" % c.microseconds
      if c.nanoseconds > 0:
          format += "%dns" % c.nanoseconds
      return format
  
imports: import pandas
  import numpy
  import re
  import warnings
  from IPython.display import display
  from pandas.tseries.offsets import CustomBusinessDay, Day, BusinessDay
  from scipy.stats import mode
label_desc: Use image node_id 14 for calling a global function with example usage: timedelta_to_string(timedelta) and returns: format