#NEWLINE# def match_detector_name( self , sname , strict = False ) : #NEWLINE# #INDENT# 'return index in self.det_desc most closely matching supplied string' #NEWLINE# s = sname . lower ( ) #NEWLINE# sw = s . split ( ) #NEWLINE# dnames = [ i . lower ( ) for i in self . det_desc ] #NEWLINE# for nam in dnames : #NEWLINE# #INDENT# if ( s == nam ) : #NEWLINE# #INDENT# return dnames . index ( sname ) #NEWLINE# #UNINDENT# #UNINDENT# for nam in dnames : #NEWLINE# #INDENT# sx = nam . split ( ) #NEWLINE# if ( sw [ 0 ] == sx [ 0 ] ) : #NEWLINE# #INDENT# return dnames . index ( i ) #NEWLINE# #UNINDENT# #UNINDENT# if ( not strict ) : #NEWLINE# #INDENT# for dnam in dnames : #NEWLINE# #INDENT# j = dnam . find ( sw [ 0 ] ) #NEWLINE# if ( j >= 0 ) : #NEWLINE# #INDENT# return dnames . index ( i ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return ( - 1 )