code: def __init__(self, trainer: "pl.Trainer") -> None:
      self.trainer = trainer
      self._progress_bar_metrics: _PBAR_DICT = {}
      self._logged_metrics: _OUT_DICT = {}
      self._callback_metrics: _OUT_DICT = {}
      self._current_fx: Optional[str] = None
      # None: hasn't started, True: first loop iteration, False: subsequent iterations
      self._first_loop_iter: Optional[bool] = None
  
imports: from typing import Any, Iterable, Optional, Union
  from lightning_utilities.core.apply_func import apply_to_collection
  from torch import Tensor
  import lightning.pytorch
  from lightning.fabric.loggers.tensorboard import _TENSORBOARD_AVAILABLE, _TENSORBOARDX_AVAILABLE
  from lightning.fabric.plugins.environments import SLURMEnvironment
  from lightning.fabric.utilities import move_data_to_device
  from lightning.fabric.utilities.apply_func import convert_tensors_to_scalars
  from lightning.pytorch.loggers import CSVLogger, Logger, TensorBoardLogger
  from lightning.pytorch.trainer.connectors.logger_connector.result import _METRICS, _OUT_DICT, _PBAR_DICT
  from lightning.pytorch.utilities.rank_zero import WarningCache
label_desc: Use image node_id 1 to create a new _LoggerConnector object  with example: obj = _LoggerConnector(trainer)