code: def setup_experiment_tracking(
      config, with_clearml, task_type="training"
  ):
      from datetime import datetime
  
      assert task_type in ("training", "testing"), task_type
  
      output_path = ""
      if idist.get_rank() == 0:
          if with_clearml:
              from clearml import Task
  
              schema = (
                  TrainvalConfigSchema
                  if task_type == "training"
                  else InferenceConfigSchema
              )
  
              task = Task.init(
                  "Pascal-VOC12 Training",
                  config.config_filepath.stem,
                  task_type=task_type,
              )
              task.connect_configuration(
                  config.config_filepath.as_posix()
              )
  
              task.upload_artifact(
                  config.script_filepath.name,
                  config.script_filepath.as_posix(),
              )
              task.upload_artifact(
                  config.config_filepath.name,
                  config.config_filepath.as_posix(),
              )
              task.connect(get_params(config, schema))
  
              output_path = Path(
                  os.environ.get("CLEARML_OUTPUT_PATH", "/tmp")
              )
              output_path = (
                  output_path
                  / "clearml"
                  / datetime.now().strftime("%Y%m%d-%H%M%S")
              )
          else:
              import shutil
  
              output_path = Path(
                  os.environ.get(
                      "OUTPUT_PATH", "/tmp/output-pascal-voc12"
                  )
              )
              output_path = (
                  output_path / task_type / config.config_filepath.stem
              )
              output_path = output_path / datetime.now().strftime(
                  "%Y%m%d-%H%M%S"
              )
              output_path.mkdir(parents=True, exist_ok=True)
  
              shutil.copyfile(
                  config.script_filepath.as_posix(),
                  output_path / config.script_filepath.name,
              )
              shutil.copyfile(
                  config.config_filepath.as_posix(),
                  output_path / config.config_filepath.name,
              )
  
          output_path = output_path.as_posix()
      return Path(idist.broadcast(output_path, src=0))
  
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 6 for calling a global function with example usage: setup_experiment_tracking(config, with_clearml, task_type) and returns: Path