code: def datetime_to_time(x):
      """Convert a datetime into a time"""
      if isinstance(x, datetime):
          return x.time()
      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 2 for calling a global function with example usage: datetime_to_time(x) and returns: x, x