class_docstr: MessageTracker(*towatch)
  
  A class for tracking if 0MQ is done using one or more messages.
  
  When you send a 0MQ message, it is not sent immediately. The 0MQ IO thread
  sends the message at some later time. Often you want to know when 0MQ has
  actually sent the message though. This is complicated by the fact that
  a single 0MQ message can be sent multiple times using different sockets.
  This class allows you to track all of the 0MQ usages of a message.
  
  Parameters
  ----------
  towatch : Event, MessageTracker, Message instances.
      This objects to track. This class can track the low-level
      Events used by the Message class, other MessageTrackers or
      actual Messages.
docstr: mt.wait(timeout=-1)
  
  Wait for 0MQ to be done with the message or until `timeout`.
  
  Parameters
  ----------
  timeout : float [default: -1, wait forever]
      Maximum time in (s) to wait before raising NotDone.
  
  Returns
  -------
  None
      if done before `timeout`
  
  Raises
  ------
  NotDone
      if `timeout` reached before I am done.
docstr_tok: ["mt.wait","(","timeout=-1",")","Wait","for","0MQ","to","be","done","with","the","message","or","until","`","timeout","`",".","Parameters","--","--","--","--","--","timeout",":","float","[","default",":","-1",",","wait","forever","]","Maximum","time","in","(","s",")","to","wait","before","raising","NotDone",".","Returns","--","--","--","-","None","if","done","before","`","timeout","`","Raises","--","--","--","NotDone","if","`","timeout","`","reached","before","I","am","done","."]
code: def wait(self, timeout: Union[float, int] = -1):
      """mt.wait(timeout=-1)
  
      Wait for 0MQ to be done with the message or until `timeout`.
  
      Parameters
      ----------
      timeout : float [default: -1, wait forever]
          Maximum time in (s) to wait before raising NotDone.
  
      Returns
      -------
      None
          if done before `timeout`
  
      Raises
      ------
      NotDone
          if `timeout` reached before I am done.
      """
      tic = time.time()
      remaining: float
      if timeout is False or timeout < 0:
          remaining = 3600 * 24 * 7  # a week
      else:
          remaining = timeout
      for evt in self.events:
          if remaining < 0:
              raise NotDone
          evt.wait(timeout=remaining)
          if not evt.is_set():
              raise NotDone
          toc = time.time()
          remaining -= toc - tic
          tic = toc
  
      for peer in self.peers:
          if remaining < 0:
              raise NotDone
          peer.wait(timeout=remaining)
          toc = time.time()
          remaining -= toc - tic
          tic = toc
  
file_path: catboost/contrib/python/pyzmq/py3/zmq/sugar/tracker.py
imports: import time
  from threading import Event
  from typing import Set, Tuple, Union
  from zmq.backend import Frame
  from zmq.error import NotDone
label_desc: Use image node_id 3 for calling the MessageTracker obj's underlying member method code with example usage: obj.wait(timeout) without return types