def get_index_kv_from_tuple(tuple_list, reverse=False):
 all_rows = []
 for (prefix, e) in tuple_list:
  for p in e.property_list():
   val = str(encode_index_pb(p.value()))
   if reverse:
    val = helper_functions.reverse_lex(val)
   params = [prefix, get_entity_kind(e), p.name(), val, str(encode_index_pb(e.key().path()))]
   index_key = get_index_key_from_params(params)
   p_vals = [index_key, (buffer((prefix + dbconstants.KEY_DELIMITER)) + encode_index_pb(e.key().path()))]
   all_rows.append(p_vals)
 return tuple((ii for ii in all_rows))

def get_index_kv_from_tuple ( tuple_list , reverse = False ) : all_rows = [ ] for ( prefix , e ) in tuple_list : for p in e . property_list ( ) : val = str ( encode_index_pb ( p . value ( ) ) ) if reverse : val = helper_functions . reverse_lex ( val ) params = [ prefix , get_entity_kind ( e ) , p . name ( ) , val , str ( encode_index_pb ( e . key ( ) . path ( ) ) ) ] index_key = get_index_key_from_params ( params ) p_vals = [ index_key , ( buffer ( ( prefix + dbconstants . KEY_DELIMITER ) ) + encode_index_pb ( e . key ( ) . path ( ) ) ) ] all_rows . append ( p_vals ) return tuple ( ( ii for ii in all_rows ) )
returns keys/value of indexes for a set of entities .