#NEWLINE# def options( self ) : #NEWLINE# #INDENT# opts = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if self . fields : #NEWLINE# #INDENT# opts [ 'mlt' ] = True #NEWLINE# opts [ 'mlt.fl' ] = ',' . join ( sorted ( self . fields ) ) #NEWLINE# #UNINDENT# if items . query_fields : #NEWLINE# #INDENT# qf_arg = [ ] #NEWLINE# items = sorted ( list ( self . query_fields . items ( ) ) , reverse = True ) #NEWLINE# for ( k , v ) in items : #NEWLINE# #INDENT# if ( v is None ) : #NEWLINE# #INDENT# qf_arg . append ( k ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# qf_arg . append ( ( '%s^%s' % ( k , float ( v ) ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# opts [ 'mlt.qf' ] = ' ' . join ( qf_arg ) #NEWLINE# #UNINDENT# for ( opt_name , opt_value ) in list ( self . kwargs . items ( ) ) : #NEWLINE# #INDENT# opt_type = self . opts [ opt_name ] #NEWLINE# opts [ ( 'mlt.%s' % opt_name ) ] = opt_type ( opt_value ) #NEWLINE# #UNINDENT# return opts