code: def calculate_time_left(
      max_updates,
      num_updates,
      timer,
      num_snapshot_iterations,
      log_interval,
      eval_interval,
  ):
      if num_updates is None or max_updates is None:
          return "Unknown"
  
      time_taken_for_log = time.time() * 1000 - timer.start
      iterations_left = max_updates - num_updates
      num_logs_left = iterations_left / log_interval
      time_left = num_logs_left * time_taken_for_log
  
      snapshot_iteration = num_snapshot_iterations / log_interval
      if eval_interval:
          snapshot_iteration *= iterations_left / eval_interval
      time_left += snapshot_iteration * time_taken_for_log
  
      return timer.get_time_hhmmss(gap=time_left)
  
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 7 for calling a global function with example usage: calculate_time_left(max_updates, num_updates, timer, num_snapshot_iterations, log_interval, eval_interval) and returns: timer, str