def get_ancestor_paths_from_ent_key(ent_key):
 ancestor_list = []
 tokens = str(ent_key).split(dbconstants.KIND_SEPARATOR)
 tokens = tokens[:(-2)]
 for num_elements in range(0, len(tokens)):
  ancestor = ''
  for token in tokens[0:(num_elements + 1)]:
   ancestor += (token + dbconstants.KIND_SEPARATOR)
  ancestor_list.append(ancestor)
 return ancestor_list

def get_ancestor_paths_from_ent_key ( ent_key ) : ancestor_list = [ ] tokens = str ( ent_key ) . split ( dbconstants . KIND_SEPARATOR ) tokens = tokens [ : ( - 2 ) ] for num_elements in range ( 0 , len ( tokens ) ) : ancestor = '' for token in tokens [ 0 : ( num_elements + 1 ) ] : ancestor += ( token + dbconstants . KIND_SEPARATOR ) ancestor_list . append ( ancestor ) return ancestor_list
get a list of key string for the ancestor portion of a composite key .