#NEWLINE# def _has_ancestor( self , filt ) : #NEWLINE# #INDENT# 'Determines if a filter includes an ancestor filter.\n\n    Args:\n      filt: a googledatastore.Filter\n\n    Returns:\n      True if the filter includes an ancestor filter, False otherwise\n    ' #NEWLINE# if filt . HasField ( 'property_filter' ) : #NEWLINE# #INDENT# op = filt . property_filter . op #NEWLINE# name = filt . property_filter . property . name #NEWLINE# return ( ( op == googledatastore . PropertyFilter . HAS_ANCESTOR ) and ( name == datastore_pbs . PROPERTY_NAME_KEY ) ) #NEWLINE# #UNINDENT# if filt . HasField ( 'composite_filter' ) : #NEWLINE# #INDENT# if ( filt . composite_filter . op == googledatastore . CompositeFilter . AND ) : #NEWLINE# #INDENT# for sub_filter in filt . composite_filter . filters : #NEWLINE# #INDENT# if self . _has_ancestor ( sub_filter ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return False