def EntityGroupKind(key):
  """Given entity primary key as Reference Proto, returns kind of entity group.

  Args:
    key: primary key of entity in ReferenceProto form.

  Returns:
    Kind of entity group that entity belongs to in string format.
  """
  return key.path().element(0).type()