code: def test_flush(capfd):
      msg = "(not flushed)"
      msg2 = "(flushed)"
  
      with m.ostream_redirect():
          m.noisy_function(msg, flush=False)
          stdout, stderr = capfd.readouterr()
          assert stdout == ""
  
          m.noisy_function(msg2, flush=True)
          stdout, stderr = capfd.readouterr()
          assert stdout == msg + msg2
  
          m.noisy_function(msg, flush=False)
  
      stdout, stderr = capfd.readouterr()
      assert stdout == msg
  
imports: from contextlib import redirect_stderr, redirect_stdout
  from io import StringIO
  from pybind11_tests import iostream
label_desc: Use image node_id 14 for calling a global function with example usage: test_flush(capfd) without return types