code: def to_seconds(time_unit: time_unit_type) -> float:
      return float(
          time_unit.total_seconds()
          if isinstance(time_unit, timedelta)
          else time_unit
      )
  
imports: import sys
  import typing
  from datetime import timedelta
label_desc: Use image node_id 4 for calling a global function with example usage: to_seconds(time_unit) and returns: float