code: def _choose_logger_component(
      self,
  ) -> Optional[Union[TensorBoard, WeightsAndBiases]]:
      logger_metadatas = (
          self.script_orchestrator.script_runner.logger_metadatas
      )
      if not logger_metadatas:
          return None
      if logger_metadatas[0].get("class_name") == "TensorBoardLogger":
          return TensorBoard(
              log_dir=self.script_orchestrator.script_runner.log_dir
          )
      if logger_metadatas[0].get("class_name") == "WandbLogger":
          return WeightsAndBiases(
              username=logger_metadatas[0]["username"],
              project_name=logger_metadatas[0]["project_name"],
              run_id=logger_metadatas[0]["run_id"],
              api_key=self.script_orchestrator.environment_variables.get(
                  "WANDB_API_KEY"
              ),
          )
      return None
  
imports: import os
  from typing import Dict, List, Optional, Union
  from core.components import TensorBoard, WeightsAndBiases
  from core.components.script_runner import ScriptRunner
  from lightning.app import LightningApp, LightningFlow
  from lightning.app.frontend import StaticWebFrontend
  from lightning.app.storage.path import Path
  from lightning.app.utilities.packaging.cloud_compute import CloudCompute
label_desc: Use image node_id 4 for calling the Main obj's underlying member method code with example usage: obj._choose_logger_component() and returns: None, None, TensorBoard, WeightsAndBiases