human
Solve the following python programming problem given the following code:
@contextmanager
def patched_input(code):
assistant
#Here is the Python program you requested.

    """Monkey patch code as though it were coming from stdin.
    """
    def lines():
        for line in code.splitlines():
            (yield line)
        raise EOFError()
    def patch_raw_input(lines=lines()):
        return next(lines)
    try:
        orig_raw_import = yapf.py3compat.raw_input
        yapf.py3compat.raw_input = patch_raw_input
        (yield)
    finally:
        yapf.py3compat.raw_input = orig_raw_import