code: def test_error_on_color_images():
      """Test that appropriate error is raised when color images are passed to PSNRB metric."""
      with pytest.raises(
          ValueError, match="`psnrb` metric expects grayscale images.*"
      ):
          peak_signal_noise_ratio_with_blocked_effect(
              torch.rand(1, 3, 16, 16), torch.rand(1, 3, 16, 16)
          )
  
file_path: torchmetrics/tests/unittests/image/test_psnrb.py
imports: import math
  import numpy
  import pytest
  import torch
  from sewar.utils import _compute_bef
  from torchmetrics.functional.image.psnrb import peak_signal_noise_ratio_with_blocked_effect
  from torchmetrics.image import PeakSignalNoiseRatioWithBlockedEffect
  from unittests import BATCH_SIZE, NUM_BATCHES
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 2 for calling a global function with example usage: test_error_on_color_images() without return types