def METHOD_NAME(text, state_hook=None, references=None):
    """
    Convert rST to a more human text form.
    This is a very loose conversion. No advanced rST features are supported.
    The generated output directly depends on the input (e.g. indentation of
    admonitions).
    """
    state_hook = state_hook or (lambda old_state, new_state, out: None)
    references = references or {}
    state = "text"
    inline_mode = "replace"
    text = TextPecker(text)
    out = io.StringIO()
    inline_single = ("*", "`")
    while True:
        char = text.read(1)
        if not char:
            break
        next = text.peek(1)  # type: str
        if state == "text":
            if char == "\\" and text.peek(1) in inline_single:
                continue
            if text.peek(-1) != "\\":
                if char in inline_single and next != char:
                    state_hook(state, char, out)
                    state = char
                    continue
                if char == next == "*":
                    state_hook(state, "**", out)
                    state = "**"
                    text.read(1)
                    continue
                if char == next == "`":
                    state_hook(state, "``", out)
                    state = "``"
                    text.read(1)
                    continue
                if text.peek(-1).isspace() and char == ":" and text.peek(5) == "ref:`":
                    # translate reference
                    text.read(5)
                    ref = ""
                    while True:
                        char = text.peek(1)
                        if char == "`":
                            text.read(1)
                            break
                        if char == "\n":
                            text.read(1)
                            continue  # merge line breaks in :ref:`...\n...`
                        ref += text.read(1)
                    try:
                        out.write(references[ref])
                    except KeyError:
                        raise ValueError(
                            "Undefined reference in Archiver help: %r — please add reference "
                            "substitution to 'rst_plain_text_references'" % ref
                        )
                    continue
                if char == ":" and text.peek(2) == ":\n":  # End of line code block
                    text.read(2)
                    state_hook(state, "code-block", out)
                    state = "code-block"
                    out.write(":\n")
                    continue
            if text.peek(-2) in ("\n\n", "") and char == next == ".":
                text.read(2)
                directive, is_directive, arguments = text.readline().partition("::")
                text.read(1)
                if not is_directive:
                    # partition: if the separator is not in the text, the leftmost output is the entire input
                    if directive == "nanorst: inline-fill":
                        inline_mode = "fill"
                    elif directive == "nanorst: inline-replace":
                        inline_mode = "replace"
                    continue
                process_directive(directive, arguments.strip(), out, state_hook)
                continue
        if state in inline_single and char == state:
            state_hook(state, "text", out)
            state = "text"
            if inline_mode == "fill":
                out.write(2 * " ")
            continue
        if state == "``" and char == next == "`":
            state_hook(state, "text", out)
            state = "text"
            text.read(1)
            if inline_mode == "fill":
                out.write(4 * " ")
            continue
        if state == "**" and char == next == "*":
            state_hook(state, "text", out)
            state = "text"
            text.read(1)
            continue
        if state == "code-block" and char == next == "\n" and text.peek(5)[1:] != "    ":
            # Foo::
            #
            #     *stuff* *code* *ignore .. all markup*
            #
            #     More arcane stuff
            #
            # Regular text...
            state_hook(state, "text", out)
            state = "text"
        out.write(char)
    assert state == "text", "Invalid final state %r (This usually indicates unmatched */**)" % state
    return out.getvalue()