<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rl_make_safe_prompt(prompt: str) -> str: # pragma: no cover """Overcome bug in GNU Readline in relation to calculation of prompt length in presence of ANSI escape codes. :param prompt: original prompt :return: prompt safe to pass to GNU Readline """

    if rl_type == RlType.GNU:
        # start code to tell GNU Readline about beginning of invisible characters
        start = "\x01"

        # end code to tell GNU Readline about end of invisible characters
        end = "\x02"

        escaped = False
        result = ""

        for c in prompt:
            if c == "\x1b" and not escaped:
                result += start + c
                escaped = True
            elif c.isalpha() and escaped:
                result += c + end
                escaped = False
            else:
                result += c

        return result

    else:
        return prompt