code: def __init__(self, called):
      def call(hook, fn, *args, **kwargs):
          out = fn(*args, **kwargs)
          d = {"name": f"Callback.{hook}"}
          if args:
              d["args"] = args
          if kwargs:
              d["kwargs"] = kwargs
          called.append(d)
          return out
  
      for h in get_members(Callback):
          attr = getattr(self, h)
          partial_h = partial(call, h, attr)
          update_wrapper(partial_h, attr)
          setattr(self, h, partial_h)
  
imports: from functools import partial, update_wrapper
  from inspect import getmembers, isfunction
  from unittest import mock
  from unittest.mock import ANY, PropertyMock
  import pytest
  import torch
  from lightning.fabric.utilities.imports import _TORCH_GREATER_EQUAL_2_0
  from lightning.pytorch import Callback, LightningDataModule, LightningModule, Trainer, __version__
  from lightning.pytorch.demos.boring_classes import BoringDataModule, BoringModel, RandomDataset
  from lightning.pytorch.utilities.model_helpers import is_overridden
  from torch import Tensor
  from torch.utils.data import DataLoader
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 1 to create a new HookedCallback object from inherited base classes: Callback with example: obj = HookedCallback(called)