#NEWLINE# def _beautify_list( self , indices ) : #NEWLINE# #INDENT# indices = list ( sorted ( set ( indices ) ) ) #NEWLINE# contiguous_indices = all ( ( ( ( indices [ i ] + 1 ) == indices [ ( i + 1 ) ] ) for i in range ( ( len ( indices ) - 1 ) ) ) ) #NEWLINE# if ( indices and contiguous_indices ) : #NEWLINE# #INDENT# return slice ( indices [ 0 ] , ( indices [ ( - 1 ) ] + 1 ) , None ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return indices