code: def compute_and_log_cm(cm_metric, iteration):
      cm = cm_metric.compute()
      # CM: values are normalized such that diagonal values represent class recalls
      cm = ConfusionMatrix.normalize(cm, "recall").cpu().numpy()
  
      if idist.get_rank() == 0:
          from clearml import Task
  
          clearml_logger = Task.current_task().get_logger()
  
          try:
              clearml_logger.report_confusion_matrix(
                  title="Final Confusion Matrix",
                  matrix=cm,
                  iteration=iteration,
                  xlabels=data.VOCSegmentationOpencv.target_names,
                  ylabels=data.VOCSegmentationOpencv.target_names,
                  extra_layout=None,
              )
          except NameError:
              # Temporary clearml bug work-around:
              # https://github.com/allegroai/clearml/pull/936
              pass
  
imports: import os
  from functools import partial
  from pathlib import Path
  import fire
  import torch
  import dataflow
  import utils
  import vis
  from py_config_runner import ConfigObject, get_params, InferenceConfigSchema, TrainvalConfigSchema
  import ignite.distributed
  from ignite.contrib.engines import common
  from ignite.engine import Engine, Events
  from ignite.handlers import Checkpoint
  from ignite.metrics import ConfusionMatrix, IoU, mIoU
  from ignite.utils import manual_seed, setup_logger
label_desc: Use image node_id 3 for calling a global function with example usage: compute_and_log_cm(cm_metric, iteration) without return types