code: def timedelta_to_seconds(x):
      """Convert a timedelta into an amount of seconds"""
      if isinstance(x, timedelta):
          return x.total_seconds()
      return x
  
imports: from datetime import date, datetime, time, timedelta
  from pygal._compat import timestamp
  from pygal.adapters import positive
  from pygal.graph.xy import XY
label_desc: Use image node_id 5 for calling a global function with example usage: timedelta_to_seconds(x) and returns: x, x