code: def timedelta_to_string(obj):
      if obj.microseconds:
          raise Exception(f"Unable to convert: {obj}")
      elif obj.seconds:
          return format_seconds(obj.total_seconds())
      elif obj.days % 7 == 0:
          return f"{obj.days // 7} weeks"
      else:
          return f"{obj.days} days"
  
file_path: superset/superset/migrations/versions/2018-07-05_15-19_3dda56f1c4c6_migrate_num_period_compare_and_period_.py
imports: import datetime
  import json
  import isodate
  from alembic import op
  from sqlalchemy import Column, Integer, String, Text
  from sqlalchemy.ext.declarative import declarative_base
  from superset import db
  from superset.utils.date_parser import parse_human_timedelta
label_desc: Use image node_id 2 for calling a global function with example usage: timedelta_to_string(obj) and returns: format_seconds, unknown, str, obj, str