def EntityKind(key):
 if key.path().element_list():
  return key.path().element_list()[(-1)].type()
 else:
  return ''

def EntityKind ( key ) : if key . path ( ) . element_list ( ) : return key . path ( ) . element_list ( ) [ ( - 1 ) ] . type ( ) else : return ''
given entity primary key as reference proto .