'Sets the prompt used by `Read Until Prompt` and `Login` in the current connection.
If ``prompt_is_regexp`` is given a true value (see `Boolean arguments`),
the given ``prompt`` is considered to be a regular expression.
The old prompt is returned and can be used to restore the prompt later.
Example:
| ${prompt} | ${regexp} = | `Set Prompt` | $ |
| `Do Something` |
| `Set Prompt` | ${prompt} | ${regexp} |
See the documentation of
[http://docs.python.org/2/library/re.html|Python re module]
for more information about the supported regular expression syntax.
Notice that possible backslashes need to be escaped in Robot Framework
test data.
See `Configuration` section for more information about global and
connection specific configuration.'

def set_prompt(self, prompt, prompt_is_regexp=False):

    self._verify_connection()
    old = self._prompt
    self._set_prompt(prompt, prompt_is_regexp)
    if old[1]:
        return (old[0].pattern, True)
    return old
