code: def test_message_pbar_state_logging_is_demoted():
      from datalad.log import LoggerHelper
  
      name = "dl-test"
      lgr = LoggerHelper(name).get_initialized_logger()
      ui = ConsoleLog()
  
      with patch("datalad.log.lgr", lgr):
          with swallow_logs(name=name, new_level=20) as cml:
              ui.message("testing 0")
              assert_not_in("Clear progress bars", cml.out)
              assert_not_in("Refresh progress bars", cml.out)
          with swallow_logs(name=name, new_level=5) as cml:
              ui.message("testing 1")
              assert_in("Clear progress bars", cml.out)
              assert_in("Refresh progress bars", cml.out)
  
file_path: datalad/datalad/ui/tests/test_dialog.py
imports: import builtins
  from io import StringIO
  from unittest.mock import call, patch
  import pytest
  from datalad.ui.progressbars import progressbars
  from datalad.utils import swallow_logs
  from ...tests.utils_pytest import assert_in, assert_not_in, assert_raises, assert_re_in, eq_, ok_endswith, ok_startswith
  from ..dialog import ConsoleLog, DialogUI, IPythonUI
label_desc: Use image node_id 9 for calling a global function with example usage: test_message_pbar_state_logging_is_demoted() without return types