Spaces:
Runtime error
Runtime error
Add some more conditions
Browse files39 unmodified lines404142434445464748495039 unmodified linescurrent_time = 0for elem in timestamps:# Threshold of 5 to see if it is a jump to another segment (also to make sure smaller segments are added togetherif elem[0] > (current_time + 5):current += 1times.append((elem[0], elem[0] + elem[1]))current_time = elem[0] + elem[1]else:times[current] = (times[current][0], elem[0] + elem[1])current_time = elem[0] + elem[1]return times, timestamps39 unmodified lines4041424344454647484950515239 unmodified linescurrent_time = 0for elem in timestamps:# Threshold of 5 to see if it is a jump to another segment (also to make sure smaller segments are added togetherif elem[0] > (current_time + 15):current += 1times.append((elem[0], elem[0] + elem[1]))current_time = elem[0] + elem[1]else:times[current] = (times[current][0], elem[0] + elem[1])current_time = elem[0] + elem[1]return_times = [x for x in times if (x[1] - x[0]) > 10]return return_times, timestamps
functions/convert_time.py+4-2