code: def test_captured_out_filter(run, capsys):
      def print_mock_progress():
          sys.stdout.write("progress 0")
          sys.stdout.flush()
          for i in range(10):
              sys.stdout.write("\b")
              sys.stdout.write(str(i))
              sys.stdout.flush()
  
      run.captured_out_filter = apply_backspaces_and_linefeeds
      run.main_function.side_effect = print_mock_progress
      run.capture_mode = "sys"
      with capsys.disabled():
          run()
          sys.stdout.flush()
      assert run.captured_out == "progress 9"
  
imports: from datetime import datetime
  import mock
  import os
  import pytest
  import tempfile
  import sys
  from sacred.run import Run
  from sacred.config.config_summary import ConfigSummary
  from sacred.utils import ObserverError, SacredInterrupt, TimeoutInterrupt, apply_backspaces_and_linefeeds
label_desc: Use image node_id 23 for calling a global function with example usage: test_captured_out_filter(run, capsys) without return types