def get_input(prompt, default=None, choices=None, option_value=None):
if option_value is not None:<EOL><INDENT>return option_value<EOL><DEDENT>choices = choices or []<EOL>while <NUM_LIT:1>:<EOL><INDENT>r = input(prompt+'<STR_LIT:U+0020>').strip()<EOL>if not r and default is not None:<EOL><INDENT>return default<EOL><DEDENT>if choices:<EOL><INDENT>if r not in choices:<EOL><INDENT>r = None<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>return r<EOL>
If option_value is not None, then return it. Otherwise get the result from 
input.