'Sets an ancestor for this query.
This restricts the query to only return result entities that are descended
from a given entity. In other words, all of the results will have the
ancestor as their parent, or parent\'s parent, or etc.
Raises BadArgumentError or BadKeyError if parent is not an existing Entity
or Key in the datastore.
Args:
# the key must be complete
ancestor: Entity or Key
Returns:
# this query
Query'

def Ancestor(self, ancestor):

    self.__ancestor_pb = _GetCompleteKeyOrError(ancestor)._ToPb()
    return self
