def mini_interactive_loop(input_func):
from IPython.core.inputsplitter import InputSplitter<EOL>isp = InputSplitter()<EOL>while isp.push_accepts_more():<EOL><INDENT>indent = '<STR_LIT:U+0020>'*isp.indent_spaces<EOL>prompt = '<STR_LIT>' + indent<EOL>line = indent + input_func(prompt)<EOL>isp.push(line)<EOL><DEDENT>src = isp.source_reset()<EOL>return src<EOL>
Minimal example of the logic of an interactive interpreter loop.

    This serves as an example, and it is used by the test system with a fake
    raw_input that simulates interactive input.