def METHOD_NAME(rst, references=None, destination=sys.stdout):
    """
    Convert *rst* to a lazy string.
    If *destination* is a file-like object connected to a terminal,
    enrich text with suitable ANSI escapes. Otherwise return plain text.
    """
    if is_terminal(destination):
        rst_state_hook = ansi_escapes
    else:
        rst_state_hook = None
    return RstToTextLazy(rst, rst_state_hook, references)