def root(self):
    """Return the root key.  This is either self or the highest parent."""
    pairs = self.__pairs
    if len(pairs) <= 1:
      return self
    return Key(pairs=pairs[:1], app=self.__app, namespace=self.__namespace)
dataset/ETHPy150Open GoogleCloudPlatform/datastore-ndb-python/ndb/key.py/Key.root/original