code: def test_rich_progress_bar_disabled(tmp_path):
      """Test that in a disabled bar there are no updates and no internal progress objects."""
      bar = RichProgressBar()
      bar.disable()
      assert bar.is_disabled
  
      model = BoringModel()
      trainer = Trainer(
          default_root_dir=tmp_path,
          limit_train_batches=2,
          limit_val_batches=2,
          limit_test_batches=2,
          limit_predict_batches=2,
          max_epochs=1,
          enable_model_summary=False,
          enable_checkpointing=False,
          callbacks=[bar],
      )
  
      with mock.patch(
          "lightning.pytorch.callbacks.progress.rich_progress.CustomProgress"
      ) as mocked:
          trainer.fit(model)
          trainer.validate(model)
          trainer.test(model)
          trainer.predict(model)
  
      mocked.assert_not_called()
      assert bar.train_progress_bar_id is None
      assert bar.val_sanity_progress_bar_id is None
      assert bar.val_progress_bar_id is None
      assert bar.test_progress_bar_id is None
      assert bar.predict_progress_bar_id is None
  
imports: import pickle
  from collections import defaultdict
  from unittest import mock
  from unittest.mock import DEFAULT, Mock
  import pytest
  from lightning.pytorch import Trainer
  from lightning.pytorch.callbacks import ProgressBar, RichProgressBar
  from lightning.pytorch.callbacks.progress.rich_progress import RichProgressBarTheme
  from lightning.pytorch.demos.boring_classes import BoringModel, RandomDataset, RandomIterableDataset
  from lightning.pytorch.loggers import CSVLogger
  from lightning.pytorch.loggers.logger import DummyLogger
  from tests_pytorch.helpers.runif import RunIf
  from torch.utils.data import DataLoader
label_desc: Use image node_id 20 for calling a global function with example usage: test_rich_progress_bar_disabled(tmp_path) without return types