<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_error(scope, error_re=None):
 """ Defines a pattern that, whenever detected in the response of the remote host, causes an error to be raised. In other words, whenever Exscript waits for a prompt, it searches the response of the host for the given pattern and raises an error if the pattern is found. :type error_re: regex :param error_re: The error pattern. """

    conn = scope.get('__connection__')
    conn.set_error_prompt(error_re)
    return True