def _substitute(self, str):
        """
        Substitute words in the string, according to the specified reflections,
        e.g. "I'm" -> "you are"

        :type str: str
        :param str: The string to be mapped
        :rtype: str
        """
        if not self.attr.get("substitute",True):return str
        return self._regex.sub(lambda mo:
                self._reflections[mo.string[mo.start():mo.end()]],
                    str.lower())
def _substitute ( self , str ) : if not self . attr . get ( "substitute" , True ) : return str return self . _regex . sub ( lambda mo : self . _reflections [ mo . string [ mo . start ( ) : mo . end ( ) ] ] , str . lower ( ) )
Substitute words in the string, according to the specified reflections,
        e.g. "I'm" -> "you are"

        :type str: str
        :param str: The string to be mapped
        :rtype: str