@register.filter
def uptime_from_seconds(seconds_since_reboot):
  """Converts float seconds_since_reboot to 'N days, hh:mm:ss'."""
  if seconds_since_reboot:
    uptime_days = datetime.timedelta(seconds=seconds_since_reboot).days
    uptime_hms = time.strftime('%H:%M:%S', time.gmtime(seconds_since_reboot))
    return '%d days, %s' % (uptime_days, uptime_hms)
  else:
    return 'unknown'
dataset/ETHPy150Open google/simian/src/simian/mac/admin/custom_filters.py/uptime_from_seconds/original