code: def estimated_steps_in_epoch(
      dataloader: Iterable[object],
      *,
      num_steps_completed: int,
      max_steps: Optional[int],
      max_steps_per_epoch: Optional[int],
  ) -> float:
      """Estimate the number of remaining steps for the current epoch."""
  
      total = float("inf")
      if isinstance(dataloader, Sized):
          try:
              total = len(dataloader)
          except (NotImplementedError, TypeError):
              pass
  
      if max_steps_per_epoch and max_steps:
          total = min(
              total,
              max_steps_per_epoch,
              max_steps - num_steps_completed,
          )
      elif max_steps:
          total = min(total, max_steps - num_steps_completed)
      elif max_steps_per_epoch:
          total = min(total, max_steps_per_epoch)
      return total
  
file_path: tnt/torchtnt/utils/progress.py
imports: from collections.abc import Sized
  from typing import Any, Dict, Iterable, Optional
label_desc: Use image node_id 1 for calling a global function with example usage: estimated_steps_in_epoch(dataloader) and returns: total