code: def _lightning_get_all_attr_holders(
      model: "pl.LightningModule", attribute: str
  ) -> List[Any]:
      """Special attribute finding for Lightning.
  
      Gets all of the objects or dicts that holds attribute. Checks for attribute in model namespace, the old hparams
      namespace/dict, and the datamodule.
  
      """
      holders: List[Any] = []
  
      # Check if attribute in model
      if hasattr(model, attribute):
          holders.append(model)
  
      # Check if attribute in model.hparams, either namespace or dict
      if hasattr(model, "hparams") and attribute in model.hparams:
          holders.append(model.hparams)
  
      trainer = model._trainer
      # Check if the attribute in datamodule (datamodule gets registered in Trainer)
      if trainer is not None and trainer.datamodule is not None:
          if hasattr(trainer.datamodule, attribute):
              holders.append(trainer.datamodule)
  
          if (
              hasattr(trainer.datamodule, "hparams")
              and attribute in trainer.datamodule.hparams
          ):
              holders.append(trainer.datamodule.hparams)
  
      return holders
  
imports: import copy
  import inspect
  import pickle
  import types
  from dataclasses import fields, is_dataclass
  from typing import Any, Dict, List, Literal, MutableMapping, Optional, Sequence, Tuple, Type, Union
  from torch import nn
  import lightning.pytorch
  from lightning.fabric.utilities.data import AttributeDict
  from lightning.pytorch.utilities.rank_zero import rank_zero_warn
label_desc: Use image node_id 8 for calling a global function with example usage: _lightning_get_all_attr_holders(model, attribute) and returns: holders