code: def done_all(self, handlers=None):
          # type: (Promise, Optional[List[Union[Dict[str, Optional[Callable]], Tuple[Callable, Callable], Callable]]]) -> None
          
          if not handlers:
              return
  
          for handler in handlers:
              if isinstance(handler, tuple):
                  s, f = handler
                  self.done(s, f)
              elif isinstance(handler, dict):
                  s = handler.get("success")  # type: ignore
                  f = handler.get("failure")  # type: ignore
  
                  self.done(s, f)
              else:
                  self.done(handler)
docs: :type handlers: list[(Any) -> object] | list[((Any) -> object, (Any) -> object)]