code: def _set_hparams(
      self, hp: Union[MutableMapping, Namespace, str]
  ) -> None:
      hp = self._to_hparams_dict(hp)
  
      if isinstance(hp, dict) and isinstance(self.hparams, dict):
          self.hparams.update(hp)
      else:
          self._hparams = hp
  
file_path: pytorch-lightning/src/lightning/pytorch/core/mixins/hparams_mixin.py
imports: import copy
  import inspect
  import types
  from argparse import Namespace
  from typing import Any, List, MutableMapping, Optional, Sequence, Union
  from lightning.fabric.utilities.data import AttributeDict
  from lightning.pytorch.utilities.parsing import save_hyperparameters
label_desc: Use image node_id 3 for calling the HyperparametersMixin obj's underlying member method code with example usage: obj._set_hparams(hp) without return types