code: def purge_bad_timestamp_files(file_list):
          "Given a list of image files, find bad frames, remove them and modify file_list"
          MAX_INITIAL_BAD_FRAMES = 15
          bad_ts = Kinect.detect_bad_timestamps(Kinect.timestamps_from_file_list(file_list))
          
          # Trivial case
          if not bad_ts:
              return file_list
  
          # No bad frames after the initial allowed
          last_bad = max(bad_ts)
          if last_bad >= MAX_INITIAL_BAD_FRAMES:
              raise Exception('Only 15 initial bad frames are allowed, but last bad frame is %d' % last_bad)
  
          # Remove all frames up to the last bad frame
          for i in range(last_bad + 1):
              os.remove(file_list[i])
  
          # Purge from the list
          file_list = file_list[last_bad+1:]
  
          return file_lisf purge_bad_timestamp_files(file_list):
          "Given a list of image files, find bad frames, remove them and modify file_list"
          MAX_INITIAL_BAD_FRAMES = 15
          bad_ts = Kinect.detect_bad_timestamps(Kinect.timestamps_from_file_list(file_list))
          
          # Trivial case
          if not bad_ts:
              return file_list
  
          # No bad frames after the initial allowed
          last_bad = max(bad_ts)
          if last_bad >= MAX_INITIAL_BAD_FRAMES:
              raise Exception('Only 15 initial bad frames are allowed, but last bad frame is %d' % last_bad)
  
          # Remove all frames up to the last bad frame
          for i in range(last_bad + 1):
              os.remove(file_list[i])
  
          # Purge from the list
          file_list = file_list[last_bad+1:]
  
          return file_list
docs: Given a list of image files, find bad frames, remove them and modify file_list