original_docstring: Takes a list of integers and squashes consecutive values into a
          string range. Returned list contains mix of strings and ints.
          
docstring: Takes a list of integers and squashes consecutive values into a
  string range. Returned list contains mix of strings and ints.
docstring_tokens: Takes a list of integers and squashes consecutive values into a string range . Returned list contains mix of strings and ints .
code: def squash_int_range(cls, ilist):
          """Takes a list of integers and squashes consecutive values into a
          string range. Returned list contains mix of strings and ints.
          """
          irange = []
          rstart = None
          rprev = None
  
          sorted(ilist)
          for i, value in enumerate(ilist):
              if rstart is None:
                  if i == (len(ilist) - 1):
                      irange.append(value)
                      break
  
                  rstart = value
  
              if rprev is not None:
                  if rprev != (value - 1):
                      if rstart == rprev:
                          irange.append(rstart)
                      else:
                          irange.append("{}-{}".format(rstart, rprev))
                          if i == (len(ilist) - 1):
                              irange.append(value)
  
                      rstart = value
                  elif i == (len(ilist) - 1):
                      irange.append("{}-{}".format(rstart, value))
                      break
  
              rprev = value
  
          return irange
code_tokens: def squash_int_range ( cls , ilist ) : irange = [ ] rstart = None rprev = None sorted ( ilist ) for i , value in enumerate ( ilist ) : if rstart is None : if i == ( len ( ilist ) - 1 ) : irange . append ( value ) break rstart = value if rprev is not None : if rprev != ( value - 1 ) : if rstart == rprev : irange . append ( rstart ) else : irange . append ( "{}-{}" . format ( rstart , rprev ) ) if i == ( len ( ilist ) - 1 ) : irange . append ( value ) rstart = value elif i == ( len ( ilist ) - 1 ) : irange . append ( "{}-{}" . format ( rstart , value ) ) break rprev = value return irange
short_docstring: Takes a list of integers and squashes consecutive values into a
  string range.
short_docstring_tokens: Takes a list of integers and squashes consecutive values into a string range .
comment: """Takes a list of integers and squashes consecutive values into a
          string range. Returned list contains mix of strings and ints.
          """