code: def _duration(value):
      if isinstance(value, datetime.timedelta):
          return value.total_seconds()
      else:
          return value
  
file_path: BigDL/python/chronos/src/bigdl/chronos/data/utils/prometheus_df.py
imports: import datetime
  import json
  from typing import Optional, Union
  from urllib.parse import urljoin
  import numpy
  import pandas
  import requests
  from bigdl.nano.utils.common import invalidInputError
label_desc: Use image node_id 4 for calling a global function with example usage: _duration(value) and returns: value, value