code: def test_log_hyperparams_being_called(
      log_hyperparams_mock, tmpdir, logger
  ):
      class TestModel(BoringModel):
          def __init__(self, param_one, param_two):
              super().__init__()
              self.save_hyperparameters(logger=logger)
  
      model = TestModel("pytorch", "lightning")
      trainer = Trainer(
          default_root_dir=tmpdir,
          max_epochs=1,
          limit_train_batches=0.1,
          limit_val_batches=0.1,
          num_sanity_val_steps=0,
          logger=TensorBoardLogger(tmpdir),
      )
      trainer.fit(model)
  
      if logger:
          log_hyperparams_mock.assert_called()
      else:
          log_hyperparams_mock.assert_not_called()
  
imports: import pickle
  from argparse import Namespace
  from copy import deepcopy
  from typing import Any, Dict, Optional
  from unittest.mock import patch
  import numpy
  import pytest
  import torch
  from lightning.fabric.utilities.logger import _convert_params, _sanitize_params
  from lightning.pytorch import Trainer
  from lightning.pytorch.demos.boring_classes import BoringDataModule, BoringModel
  from lightning.pytorch.loggers import Logger, TensorBoardLogger
  from lightning.pytorch.loggers.logger import DummyExperiment, DummyLogger
  from lightning.pytorch.loggers.utilities import _scan_checkpoints
  from lightning.pytorch.utilities.rank_zero import rank_zero_only
label_desc: Use image node_id 9 for calling a global function with example usage: test_log_hyperparams_being_called(log_hyperparams_mock, tmpdir, logger) without return types