#NEWLINE# def _sorted_from_obj( self , data ) : #NEWLINE# #INDENT# if isinstance ( data , list ) : #NEWLINE# #INDENT# items = data #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# items = [ ( i [ 0 ] , j ) for i in data . lists ( ) for j in i [ 1 ] ] #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# items = iteritems ( data ) #NEWLINE# #UNINDENT# #UNINDENT# return sorted ( items , key = ( lambda p : p [ 0 ] ) )