def RemoveNativelySupportedComponents(filters, orders, exists):
 (filters, orders) = Normalize(filters, orders, exists)
 for f in filters:
  if (f.op() in EXISTS_OPERATORS):
   return (filters, orders)
 has_key_desc_order = False
 if (orders and (orders[(-1)].property() == datastore_types.KEY_SPECIAL_PROPERTY)):
  if (orders[(-1)].direction() == ASCENDING):
   orders = orders[:(-1)]
  else:
   has_key_desc_order = True
 if (not has_key_desc_order):
  for f in filters:
   if ((f.op() in INEQUALITY_OPERATORS) and (f.property(0).name() != datastore_types.KEY_SPECIAL_PROPERTY)):
    break
  else:
   filters = [f for f in filters if (f.property(0).name() != datastore_types.KEY_SPECIAL_PROPERTY)]
 return (filters, orders)

def RemoveNativelySupportedComponents ( filters , orders , exists ) : ( filters , orders ) = Normalize ( filters , orders , exists ) for f in filters : if ( f . op ( ) in EXISTS_OPERATORS ) : return ( filters , orders ) has_key_desc_order = False if ( orders and ( orders [ ( - 1 ) ] . property ( ) == datastore_types . KEY_SPECIAL_PROPERTY ) ) : if ( orders [ ( - 1 ) ] . direction ( ) == ASCENDING ) : orders = orders [ : ( - 1 ) ] else : has_key_desc_order = True if ( not has_key_desc_order ) : for f in filters : if ( ( f . op ( ) in INEQUALITY_OPERATORS ) and ( f . property ( 0 ) . name ( ) != datastore_types . KEY_SPECIAL_PROPERTY ) ) : break else : filters = [ f for f in filters if ( f . property ( 0 ) . name ( ) != datastore_types . KEY_SPECIAL_PROPERTY ) ] return ( filters , orders )
removes query components that are natively supported by the datastore .