code: def framesToFrameRanges(frames, zfill=0):
          
          _build = FrameSet._build_frange_part
          curr_start = None
          curr_stride = None
          curr_frame = None
          last_frame = None
          curr_count = 0
          for curr_frame in frames:
              if curr_start is None:
                  curr_start = curr_frame
                  last_frame = curr_frame
                  curr_count += 1
                  continue
              if curr_stride is None:
                  curr_stride = abs(curr_frame-curr_start)
              new_stride = abs(curr_frame-last_frame)
              if curr_stride == new_stride:
                  last_frame = curr_frame
                  curr_count += 1
              elif curr_count == 2 and curr_stride != 1:
                  yield _build(curr_start, curr_start, None, zfill)
                  curr_start = last_frame
                  curr_stride = new_stride
                  last_frame = curr_frame
              else:
                  yield _build(curr_start, last_frame, curr_stride, zfill)
                  curr_stride = None
                  curr_start = curr_frame
                  last_frame = curr_frame
                  curr_count = 1
          if curr_count == 2 and curr_stride != 1:
              yield _build(curr_start, curr_start, None, zfill)
              yield _build(curr_frame, curr_frame, None, zfill)
          else:
              yield _build(curr_start, curr_frame, curr_stride, zfill)
docs: Converts a sequence of frames to a series of padded
          frame range strings.
  
          Args:
              frames (collections.Iterable): sequence of frames to process
              zfill (int): width for zero padding
  
          Yields:
              str: