code: def format_timedelta_ticks(x, pos, n_decimals):
      """
      Convert seconds to 'D days HH:MM:SS.F'
      """
      s, ns = divmod(x, 1e9)
      m, s = divmod(s, 60)
      h, m = divmod(m, 60)
      d, h = divmod(h, 24)
      decimals = int(ns * 10 ** (n_decimals - 9))
      s = r"{:02d}:{:02d}:{:02d}".format(int(h), int(m), int(s))
      if n_decimals > 0:
          s += ".{{:0{:0d}d}}".format(n_decimals).format(decimals)
      if d != 0:
          s = "{:d} days ".format(int(d)) + s
      return s
  
imports: import functools
  from matplotlib import pylab
  import numpy
  from pandas._libs.tslibs.frequencies import FreqGroup, get_base_alias, get_freq, is_subperiod, is_superperiod
  from pandas._libs.tslibs.period import Period
  import pandas.compat
  from pandas.core.dtypes.generic import ABCDatetimeIndex, ABCPeriodIndex, ABCTimedeltaIndex
  from pandas.io.formats.printing import pprint_thing
  from pandas.plotting._converter import TimeSeries_DateFormatter, TimeSeries_DateLocator, TimeSeries_TimedeltaFormatter
  import pandas.tseries.frequencies
  from pandas.tseries.offsets import DateOffset
label_desc: Use image node_id 13 for calling a global function with example usage: format_timedelta_ticks(x, pos, n_decimals) and returns: s