#NEWLINE# def run( self , table ) : #NEWLINE# #INDENT# '\n        :returns:\n            :class:`int`\n        ' #NEWLINE# column = c . columns [ self . _column_name ] #NEWLINE# if self . _comparer : #NEWLINE# #INDENT# if six . PY3 : #NEWLINE# #INDENT# data_sorted = sorted ( column . values ( ) , key = cmp_to_key ( self . _comparer ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# data_sorted = sorted ( column . values ( ) , cmp = self . _comparer ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# data_sorted = column . values_sorted ( ) #NEWLINE# #UNINDENT# if self . _reverse : #NEWLINE# #INDENT# data_sorted . reverse ( ) #NEWLINE# #UNINDENT# ranks = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# rank = 0 #NEWLINE# for c in data_sorted : #NEWLINE# #INDENT# rank += 1 #NEWLINE# if ( c in ranks ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# ranks [ c ] = Decimal ( rank ) #NEWLINE# #UNINDENT# new_column = [ ] #NEWLINE# for row in table . rows : #NEWLINE# #INDENT# new_column . append ( ranks [ row [ self . _column_name ] ] ) #NEWLINE# #UNINDENT# return new_column