#NEWLINE# def matches_subject_class( self , subject ) : #NEWLINE# #INDENT# '\n        subject can be either Classes or instances of classes\n        self.subjects can either be string or Classes\n        ' #NEWLINE# for sub in self . subjects : #NEWLINE# #INDENT# if inspect . isclass ( sub ) : #NEWLINE# #INDENT# if inspect . isclass ( subject ) : #NEWLINE# #INDENT# return issubclass ( subject , sub ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return isinstance ( subject , sub ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( sub , string_types ) : #NEWLINE# #INDENT# if inspect . isclass ( subject ) : #NEWLINE# #INDENT# return ( subject . __name__ == sub ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( subject . __class__ . __name__ == sub ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return False