code: def lightning_hasattr(
      model: "pl.LightningModule", attribute: str
  ) -> bool:
      """Special hasattr for Lightning.
  
      Checks for attribute in model namespace, the old hparams namespace/dict, and the datamodule.
  
      """
      return (
          _lightning_get_first_attr_holder(model, attribute) is not None
      )
  
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 10 for calling a global function with example usage: lightning_hasattr(model, attribute) and returns: unknown