code: def test_restricted_classmethod():
      with pytest.raises(
          TypeError, match="cannot be called on an instance"
      ):
          RestrictedClass().restricted_cmethod()
  
      RestrictedClass.restricted_cmethod()
  
file_path: pytorch-lightning/tests/tests_pytorch/utilities/test_model_helpers.py
imports: import logging
  import pytest
  import torch.nn
  from lightning.pytorch import LightningDataModule
  from lightning.pytorch.demos.boring_classes import BoringDataModule, BoringModel
  from lightning.pytorch.utilities.model_helpers import _ModuleMode, _restricted_classmethod, is_overridden
  from lightning_utilities import module_available
label_desc: Use image node_id 3 for calling a global function with example usage: test_restricted_classmethod() without return types