code: def then_all(self, handlers=None):
          # type: (Promise, List[Callable]) -> List[Promise]
          
          if not handlers:
              return []
  
          promises = []  # type: List[Promise]
  
          for handler in handlers:
              if isinstance(handler, tuple):
                  s, f = handler
  
                  promises.append(self.then(s, f))
              elif isinstance(handler, dict):
                  s = handler.get("success")
                  f = handler.get("failure")
  
                  promises.append(self.then(s, f))
              else:
                  promises.append(self.then(handler))
  
          return promises
docs: Utility function which calls 'then' for each handler provided. Handler can either
          be a function in which case it is used as success handler, or a tuple containing
          the success and the failure handler, where each of them could be None.
          :type handlers: list[(Any) -> object] | list[((Any) -> object, (Any) -> object)]
          :param handlers
          :rtype : list[Promise]