#NEWLINE# def _SetAncestor( self , value ) : #NEWLINE# #INDENT# 'Setter to be used for public ancestor property on query info.\n\n    Args:\n      value: A potential value for an ancestor.\n\n    Raises:\n      AttributeError: if query on the object is already final.\n      AttributeError: if the ancestor has already been set.\n      TypeError: if the value to be set is not an instance of ndb.Key.\n    ' #NEWLINE# if ( self . _query_final is not None ) : #NEWLINE# #INDENT# raise AttributeError ( "Can't set ancestor. Query info is final." ) #NEWLINE# #UNINDENT# if ( self . _ancestor is not None ) : #NEWLINE# #INDENT# raise AttributeError ( "Ancestor can't be set twice." ) #NEWLINE# #UNINDENT# if ( not isinstance ( value , ndb . Key ) ) : #NEWLINE# #INDENT# raise TypeError ( 'Ancestor must be an instance of ndb.Key.' ) #NEWLINE# #UNINDENT# self . _ancestor = value