#NEWLINE# def RemoveNativelySupportedComponents( filters , orders ) : #NEWLINE# #INDENT# ' Removes query components that are natively supported by the datastore.\n\n  The resulting filters and orders should not be used in an actual query.\n\n  Returns\n    (filters, orders) the reduced set of filters and orders\n  ' #NEWLINE# ( filters , orders ) = Normalize ( filters , orders ) #NEWLINE# has_key_desc_order = False #NEWLINE# if ( orders and ( orders [ ( - 1 ) ] . property ( ) == datastore_types . _KEY_SPECIAL_PROPERTY ) ) : #NEWLINE# #INDENT# if ( orders [ ( - 1 ) ] . direction ( ) == ASCENDING ) : #NEWLINE# #INDENT# orders = orders [ : ( - 1 ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# has_key_desc_order = True #NEWLINE# #UNINDENT# #UNINDENT# if ( not has_key_desc_order ) : #NEWLINE# #INDENT# for f in filters : #NEWLINE# #INDENT# if ( ( f . op ( ) in INEQUALITY_OPERATORS ) and ( f . property ( 0 ) . name ( ) != datastore_types . _KEY_SPECIAL_PROPERTY ) ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# filters = [ f for f in filters if ( f . property ( 0 ) . name ( ) != datastore_types . _KEY_SPECIAL_PROPERTY ) ] #NEWLINE# #UNINDENT# #UNINDENT# return ( filters , orders )