from python.util.time_util import int_to_min_sec def calc_apnea(idx, top_n, score, name): result = '' # print(' calc_apnea, idx, top_n, score, name ', int_to_min_sec(idx), top_n, '%.2f' % score, name) which_sec = idx start_sec = -1 if name == 'Snoring': result = (' idx, top_n, score, name: ' + int_to_min_sec(idx) + ', ' + str(top_n) + ', ' + ( '%.2f' % score) + ', ' + name) # if name == 'Snoring': # if start_sec == 0: start_sec = which_sec # else: # if snore_sec == 60: start_sec = 0 return result