code: def __init__(
      self,
      clearml_cfg: DictConfig,
      log_dir: str,
      prefix: str,
      save_best_model: bool,
      postfix: str = ".nemo",
  ) -> None:
      if not HAVE_CLEARML_LOGGER:
          raise ImportError(
              "Found create_clearml_logger is True."
              "But ClearML not found. Please see the README for installation instructions:"
              "https://github.com/allegroai/clearml"
          )
  
      self.clearml_task = None
      self.clearml_model = None
      self.clearml_cfg = clearml_cfg
      self.path_nemo_model = os.path.abspath(
          os.path.expanduser(
              os.path.join(log_dir, "checkpoints", prefix + postfix)
          )
      )
      self.save_best_model = save_best_model
      self.prefix = prefix
      self.previos_best_model_path = None
      self.last_metrics = None
      self.save_blocked = True
  
      self.project_name = os.getenv(
          "CLEARML_PROJECT",
          clearml_cfg.project if clearml_cfg.project else "NeMo",
      )
      self.task_name = os.getenv(
          "CLEARML_TASK",
          clearml_cfg.task
          if clearml_cfg.task
          else f"Trainer {self.prefix}",
      )
  
      tags = ["NeMo"]
      if clearml_cfg.tags:
          tags.extend(clearml_cfg.tags)
  
      self.clearml_task: Task = Task.init(
          project_name=self.project_name,
          task_name=self.task_name,
          auto_connect_frameworks={
              "pytorch": clearml_cfg.connect_pytorch
          },
          output_uri=True,
          tags=tags,
      )
  
      if clearml_cfg.model_name:
          model_name = clearml_cfg.model_name
      elif self.prefix:
          model_name = self.prefix
      else:
          model_name = self.task_name
  
      if clearml_cfg.log_model:
          self.clearml_model: OutputModel = OutputModel(
              name=model_name,
              task=self.clearml_task,
              tags=tags,
              framework="NeMo",
          )
  
imports: import os
  from argparse import Namespace
  from dataclasses import dataclass
  from pathlib import Path
  from typing import Any, List, Literal, Mapping, Optional, Union
  import pandas
  from lightning_utilities.core.apply_func import apply_to_collection
  from omegaconf import DictConfig, ListConfig, OmegaConf
  from pytorch_lightning.callbacks import Checkpoint
  from pytorch_lightning.loggers import Logger
  from pytorch_lightning.utilities.parsing import AttributeDict
  from torch import Tensor
  from nemo.utils import logging
label_desc: Use image node_id 3 to create a new ClearMLLogger object from inherited base classes: Logger with example: obj = ClearMLLogger(clearml_cfg, log_dir, prefix, save_best_model, postfix)