#NEWLINE# def _slice_match_level( self , overlay_items ) : #NEWLINE# #INDENT# '\n        Find the match strength for a list of overlay items that must\n        be exactly the same length as the pattern specification.\n        ' #NEWLINE# level = 0 #NEWLINE# for ( spec , el ) in zip ( self . _pattern_spec , overlay_items ) : #NEWLINE# #INDENT# if ( spec [ 0 ] != type ( el ) . __name__ ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# level += 1 #NEWLINE# if ( len ( spec ) == 1 ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# group = [ el . group , group_sanitizer ( el . group , escape = False ) ] #NEWLINE# if ( spec [ 1 ] in group ) : #NEWLINE# #INDENT# level += 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# if ( len ( spec ) == 3 ) : #NEWLINE# #INDENT# group = [ el . label , label_sanitizer ( el . label , escape = False ) ] #NEWLINE# if ( spec [ 2 ] in group ) : #NEWLINE# #INDENT# level += 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return level