def parse_substitutions(self, messages):
<EOL>if not self._substitutions:<EOL><INDENT>self._log.info('<STR_LIT>')<EOL>return messages<EOL><DEDENT>self._log.info('<STR_LIT>')<EOL>def substitute(sub_group, sub_message):<EOL><INDENT>word, substitution = sub_group<EOL>return word.sub(substitution, sub_message)<EOL><DEDENT>normalized, preserve_case, raw = messages<EOL>for sub_normalized, sub_preserve_case, sub_raw in self._substitutions:<EOL><INDENT>normalized = substitute(sub_normalized, normalized)<EOL>preserve_case = substitute(sub_preserve_case, preserve_case)<EOL>raw = substitute(sub_raw, raw)<EOL><DEDENT>return normalized, preserve_case, raw<EOL>
Parse substitutions in a supplied message
:param messages: A tuple messages being parsed (normalized, case preserved, raw)
:type  messages: tuple of (str, str, str)

:return: Substituted messages (normalized, case preserved, raw)
:rtype : tuple of (str, str, str)