#NEWLINE# def filter( self , data ) : #NEWLINE# #INDENT# if ( ( not self . before ) or ( not self . after ) ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# if PYTHON2 : #NEWLINE# #INDENT# trans = dict ( zip ( [ ord ( c ) for c in self . before ] , self . after ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# trans = str . maketrans ( self . before , self . after ) #NEWLINE# #UNINDENT# return data . translate ( trans )