#NEWLINE# def activation( cues , W ) : #NEWLINE# #INDENT# if isinstance ( W , basestring ) : #NEWLINE# #INDENT# cues = cues . split ( '_' ) #NEWLINE# #UNINDENT# return W [ [ ( c in cues ) for c in W . index ] ] . sum ( )