'Returns this key\'s entity group as a Key.
Note that the returned Key will be incomplete if this Key is for a root
entity and it is incomplete.'

def entity_group(self):

    group = Key._FromPb(self.__reference)
    del group.__reference.path().element_list()[1:]
    return group
