#NEWLINE# def __instancecheck__( cls , instance ) : #NEWLINE# #INDENT# 'Override for isinstance(instance, cls).' #NEWLINE# subclass = getattr ( instance , '__class__' , None ) #NEWLINE# if ( ( subclass is not None ) and ( subclass in cls . _abc_cache ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# subtype = type ( instance ) #NEWLINE# if ( subtype is _InstanceType ) : #NEWLINE# #INDENT# subtype = subclass #NEWLINE# #UNINDENT# if ( ( subtype is subclass ) or ( subclass is None ) ) : #NEWLINE# #INDENT# if ( ( cls . _abc_negative_cache_version == ABCMeta . _abc_invalidation_counter ) and ( subtype in cls . _abc_negative_cache ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# return cls . __subclasscheck__ ( subtype ) #NEWLINE# #UNINDENT# return ( cls . __subclasscheck__ ( subclass ) or cls . __subclasscheck__ ( subtype ) )