class_docstr: Drop-in replacement for @classmethod, but raises an exception when the decorated method is called on an instance
  instead of a class type.
class_docstr_tok: ["Drop-in","replacement","for","@","classmethod",",","but","raises","an","exception","when","the","decorated","method","is","called","on","an","instance","instead","of","a","class","type","."]
code: def __init__(
      self, method: Callable[Concatenate[_T, _P], _R_co]
  ) -> None:
      self.method = method
  
file_path: pytorch-lightning/src/lightning/pytorch/utilities/model_helpers.py
imports: import inspect
  import logging
  import os
  from types import MethodType
  from typing import TYPE_CHECKING, Any, Callable, Dict, Generic, Optional, Type, TypeVar
  from lightning_utilities.core.imports import RequirementCache
  from torch import nn
  from typing_extensions import Concatenate, ParamSpec
  import lightning.pytorch
label_desc: Use image node_id 1 to create a new _restricted_classmethod_impl object from inherited base classes: Generic with example: obj = _restricted_classmethod_impl(method)