code: def collapse_range(arg, value_delimiter=',', range_delimiter='-'):
      
      values = list()
      expanded = arg.split(value_delimiter)
      range_start = None
  
      for v1, v2 in lookahead(expanded):
          if v2:
              v1 = int(v1)
              v2 = int(v2)
              if (v1 + 1) == v2:
                  if not range_start:
                      range_start = v1
              elif range_start:
                  item = '{}{}{}'.format(range_start, range_delimiter, v1)
                  values.extend([item])
                  range_start = None
              else:
                  values.extend([v1])
          elif range_start:
              item = '{}{}{}'.format(range_start, range_delimiter, v1)
              values.extend([item])
              range_start = None
          else:
              values.extend([v1])
      return [str(x) for x in values]
docs: Collapses a list of values into a range set
  
      :param arg: The list of values to collapse
      :param value_delimiter: The delimiter that separates values
      :param range_delimiter: The delimiter that separates a value range
  
      :return: An array of collapsed string values
      :rtype: list