code: def set_logger_formatter(logger, rank=None):
      rank_component = f"rank {rank}:" if rank is not None else ""
      fmt = f"{rank_component}%(asctime)s:%(name)s:%(lineno)s:%(levelname)s: %(message)s"
      formatter = logging.Formatter(fmt=fmt)
      for handler in logger.handlers:
          handler.setFormatter(formatter)
  
file_path: coremltools/coremltools/optimize/torch/_logging.py
imports: import logging
  import os
label_desc: Use image node_id 3 for calling a global function with example usage: set_logger_formatter(logger, rank) without return types