def infer_time_unit(time_seconds_arr):
 if (len(time_seconds_arr) == 0):
  return u'hours'
 max_time_seconds = max(time_seconds_arr)
 if (max_time_seconds <= (60 * 2)):
  return u'seconds'
 elif (max_time_seconds <= ((60 * 60) * 2)):
  return u'minutes'
 elif (max_time_seconds <= (((24 * 60) * 60) * 2)):
  return u'hours'
 else:
  return u'days'

def infer_time_unit ( time_seconds_arr ) : if ( len ( time_seconds_arr ) == 0 ) : return u'hours' max_time_seconds = max ( time_seconds_arr ) if ( max_time_seconds <= ( 60 * 2 ) ) : return u'seconds' elif ( max_time_seconds <= ( ( 60 * 60 ) * 2 ) ) : return u'minutes' elif ( max_time_seconds <= ( ( ( 24 * 60 ) * 60 ) * 2 ) ) : return u'hours' else : return u'days'
determine the most appropriate time unit for an array of time durations specified in seconds .