code: def loop(
      iterator_: Union[Collection, range, int],
      *,
      is_track: bool = True,
      is_print_iteration_time: bool = True,
  ):
      """
      This has multiple overloads
  
      .. function:: loop(iterator_: range, *, is_track=True, is_print_iteration_time=True)
          :noindex:
  
      .. function:: loop(iterator_: int, *, is_track=True, is_print_iteration_time=True)
          :noindex:
  
      .. function:: loop(iterator_: Collection, *, is_track=True, is_print_iteration_time=True)
          :noindex:
  
      This creates a monitored loop. This is designed for training loops.
      It has better monitoring than using :func:`iterate` or :func:`enum`.
  
      Arguments:
          iterator_ (Union[Collection, range, int]): The iterator
  
      Keyword Arguments:
          is_track (bool, optional): Whether track the loop time using :mod:`labml.tracker`.
              Default to ``True``.
          is_print_iteration_time (bool, optional): Whether to print iteration time. Default to ``True``.
      """
  
      if type(iterator_) == int:
          return _internal().loop(
              range(iterator_),
              is_track=is_track,
              is_print_iteration_time=is_print_iteration_time,
          )
      else:
          return _internal().loop(
              iterator_,
              is_track=is_track,
              is_print_iteration_time=is_print_iteration_time,
          )
  
imports: import functools
  from typing import Iterable, Sized, Collection, Callable, Tuple, Any, Dict
  from typing import Union, Optional, overload
  from labml.internal.monitor import TimeSummary
  from labml.internal.monitor import monitor_singleton
label_desc: Use image node_id 13 for calling a global function with example usage: loop(iterator_) and returns: _internal, _internal