code: def log_progress(info: Union[Dict, Any], log_format="simple"):
      """Useful for logging progress dict.
  
      Args:
          info (dict|any): If dict, will be logged as key value pair. Otherwise,
              it will be logged directly.
  
          log_format (str, optional): json|simple. Defaults to "simple".
              Will use simple mode.
      """
      caller, key = _find_caller()
      logger = logging.getLogger(caller)
  
      if not isinstance(info, collections.abc.Mapping):
          logger.info(info)
  
      if log_format == "simple":
          config = registry.get("config")
          if config:
              log_format = config.training.log_format
  
      if log_format == "simple":
          output = ", ".join(
              [f"{key}: {value}" for key, value in info.items()]
          )
      elif log_format == "json":
          output = json.dumps(info)
      else:
          output = str(info)
  
      logger.info(output)
  
imports: import collections
  import collections.abc
  import functools
  import json
  import logging
  import os
  import sys
  import time
  from functools import wraps
  from typing import Any, Callable, Dict, Optional, Union
  import torch
  from mmf.common.registry import registry
  from mmf.utils.configuration import get_mmf_env
  from mmf.utils.distributed import get_rank, is_main, is_xla
  from mmf.utils.file_io import PathManager
  from mmf.utils.timer import Timer
  from termcolor import colored
label_desc: Use image node_id 8 for calling a global function with example usage: log_progress(info, log_format) without return types