def get_entity_kind(key_path):
 if isinstance(key_path, entity_pb.EntityProto):
  key_path = key_path.key()
 return key_path.path().element_list()[(-1)].type()

def get_entity_kind ( key_path ) : if isinstance ( key_path , entity_pb . EntityProto ) : key_path = key_path . key ( ) return key_path . path ( ) . element_list ( ) [ ( - 1 ) ] . type ( )
returns the kind of the entity .