def get_composite_indexes_rows(entities, composite_indexes):
 if (len(entities) == 0):
  return []
 row_keys = []
 for ent in entities:
  for index_def in composite_indexes:
   kind = get_entity_kind(ent.key())
   if (index_def.definition().entity_type() != kind):
    continue
   prop_name_def_list = [index_prop.name() for index_prop in index_def.definition().property_list()]
   all_prop_names_in_ent = [prop.name() for prop in ent.property_list()]
   has_values = True
   for index_prop_name in prop_name_def_list:
    if (index_prop_name not in all_prop_names_in_ent):
     has_values = False
    if (index_prop_name == '__key__'):
     has_values = True
   if (not has_values):
    continue
   composite_index_keys = get_composite_index_keys(index_def, ent)
   row_keys.extend(composite_index_keys)
 return row_keys

def get_composite_indexes_rows ( entities , composite_indexes ) : if ( len ( entities ) == 0 ) : return [ ] row_keys = [ ] for ent in entities : for index_def in composite_indexes : kind = get_entity_kind ( ent . key ( ) ) if ( index_def . definition ( ) . entity_type ( ) != kind ) : continue prop_name_def_list = [ index_prop . name ( ) for index_prop in index_def . definition ( ) . property_list ( ) ] all_prop_names_in_ent = [ prop . name ( ) for prop in ent . property_list ( ) ] has_values = True for index_prop_name in prop_name_def_list : if ( index_prop_name not in all_prop_names_in_ent ) : has_values = False if ( index_prop_name == '__key__' ) : has_values = True if ( not has_values ) : continue composite_index_keys = get_composite_index_keys ( index_def , ent ) row_keys . extend ( composite_index_keys ) return row_keys
get the composite indexes keys in the db for the given entities .