code: def fake_input(inputs):
      """Temporarily replace the input() function to return the given values
  
      Use as a context manager:
  
      with fake_input(['result1', 'result2']):
          ...
  
      Values are returned in order. If input() is called again after the last value
      was used, EOFError is raised.
      """
      it = iter(inputs)
  
      def mock_input(prompt=""):
          try:
              return next(it)
          except StopIteration as e:
              raise EOFError("No more inputs given") from e
  
      return patch("builtins.input", mock_input)
  
imports: import os
  from pathlib import Path
  import re
  import sys
  import tempfile
  import unittest
  from contextlib import contextmanager
  from io import StringIO
  from subprocess import Popen, PIPE
  from unittest.mock import patch
  from traitlets.config.loader import Config
  from IPython.utils.process import get_output_error_code
  from IPython.utils.text import list_strings
  from IPython.utils.io import temp_pyfile, Tee
  from IPython.utils import py3compat
  from .None import decorators
  from .None import skipdoctest
label_desc: Use image node_id 11 for calling a global function with example usage: fake_input(inputs) and returns: patch, next