code: def test_pbar_errors():
      with pytest.raises(
          ModuleNotFoundError,
          match=r"This contrib module requires tqdm to be installed",
      ):
          with patch.dict("sys.modules", {"tqdm.autonotebook": None}):
              ProgressBar()
  
      pbar = ProgressBar()
      with pytest.raises(
          ValueError, match=r"Logging event abc is not in allowed"
      ):
          pbar.attach(
              Engine(lambda e, b: None),
              event_name=Namespace(name="abc"),
          )
  
imports: import sys
  import time
  from argparse import Namespace
  from unittest.mock import patch
  import numpy
  import pytest
  import torch
  from packaging.version import Version
  from ignite.contrib.handlers import ProgressBar
  from ignite.engine import Engine, Events
  from ignite.handlers import TerminateOnNan
  from ignite.metrics import RunningAverage
label_desc: Use image node_id 3 for calling a global function with example usage: test_pbar_errors() without return types