#NEWLINE# @ staticmethod #NEWLINE# def collapse_hintmask( program ) : #NEWLINE# #INDENT# 'Takes in a charstring and returns the same charstring\n        with hintmasks combined into a single element' #NEWLINE# piter = iter ( enumerate ( i ) ) #NEWLINE# for ( i , tok ) in piter : #NEWLINE# #INDENT# if ( tok in ( 'hintmask' , 'cntrmask' ) ) : #NEWLINE# #INDENT# program [ i : ( i + 2 ) ] = [ ( program [ i ] , program [ ( i + 1 ) ] ) ]