code: def test_tensorboard_save_hparams_to_yaml_once(tmp_path):
      model = BoringModel()
      logger = TensorBoardLogger(
          save_dir=tmp_path, default_hp_metric=False
      )
      trainer = Trainer(
          max_steps=1, default_root_dir=tmp_path, logger=logger
      )
      assert trainer.log_dir == trainer.logger.log_dir
      trainer.fit(model)
  
      hparams_file = "hparams.yaml"
      assert os.path.isfile(os.path.join(trainer.log_dir, hparams_file))
      assert not os.path.isfile(os.path.join(tmp_path, hparams_file))
  
imports: import logging
  import os
  from argparse import Namespace
  from unittest import mock
  from unittest.mock import Mock
  import numpy
  import pytest
  import torch
  import yaml
  from lightning.pytorch import Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.loggers import TensorBoardLogger
  from lightning.pytorch.loggers.tensorboard import _TENSORBOARD_AVAILABLE
  from lightning.pytorch.utilities.imports import _OMEGACONF_AVAILABLE
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 15 for calling a global function with example usage: test_tensorboard_save_hparams_to_yaml_once(tmp_path) without return types