def censor(self, input_text):
bad_words = self.get_profane_words()<EOL>res = input_text<EOL>for word in bad_words:<EOL><INDENT>regex_string = r'<STR_LIT>' if self._no_word_boundaries else r'<STR_LIT>'<EOL>regex_string = regex_string.format(word)  <EOL>regex = re.compile(regex_string, re.IGNORECASE)<EOL>res = regex.sub(self._censor_char * len(word), res)<EOL><DEDENT>return res<EOL>
Returns input_text with any profane words censored.