<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def framesToFrameRange(frames, sort=True, zfill=0, compress=False):
 """ Converts an iterator of frames into a frame range string. Args: frames (collections.Iterable):
 sequence of frames to process sort (bool):
 sort the sequence before processing zfill (int):
 width for zero padding compress (bool):
 remove any duplicates before processing Returns: str: """

        if compress:
            frames = unique(set(), frames)
        frames = list(frames)
        if not frames:
            return ''
        if len(frames) == 1:
            return pad(frames[0], zfill)
        if sort:
            frames.sort()
        return ','.join(FrameSet.framesToFrameRanges(frames, zfill))