<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_password_prompt(self, regex=None):
 """ Defines a pattern that is used to monitor the response of the connected host for a password prompt. :type regex: RegEx :param regex: The pattern that, when matched, causes an error. """

        if regex is None:
            self.manual_password_re = regex
        else:
            self.manual_password_re = to_regexs(regex)