nodes: 0, module; 1, function_definition; 2, function_name:framesToFrameRange; 3, parameters; 4, block; 5, identifier:frames; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, if_statement; 11, expression_statement; 12, if_statement; 13, if_statement; 14, if_statement; 15, return_statement; 16, identifier:sort; 17, True; 18, identifier:zfill; 19, integer:0; 20, identifier:compress; 21, False; 22, comment:"""
          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:
          """; 23, identifier:compress; 24, block; 25, assignment; 26, not_operator; 27, block; 28, comparison_operator:len(frames) == 1; 29, block; 30, identifier:sort; 31, block; 32, call; 33, expression_statement; 34, identifier:frames; 35, call; 36, identifier:frames; 37, return_statement; 38, call; 39, integer:1; 40, return_statement; 41, expression_statement; 42, attribute; 43, argument_list; 44, assignment; 45, identifier:list; 46, argument_list; 47, string; 48, identifier:len; 49, argument_list; 50, call; 51, call; 52, string; 53, identifier:join; 54, call; 55, identifier:frames; 56, call; 57, identifier:frames; 58, identifier:frames; 59, identifier:pad; 60, argument_list; 61, attribute; 62, argument_list; 63, string_content:,; 64, attribute; 65, argument_list; 66, identifier:unique; 67, argument_list; 68, subscript; 69, identifier:zfill; 70, identifier:frames; 71, identifier:sort; 72, identifier:FrameSet; 73, identifier:framesToFrameRanges; 74, identifier:frames; 75, identifier:zfill; 76, call; 77, identifier:frames; 78, identifier:frames; 79, integer:0; 80, identifier:set; 81, argument_list
code: 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))