code: def test_done_all():
      counter = [0]
  
      def inc(_):
          counter[0] += 1
  
      def dec(_):
          counter[0] -= 1
  
      p = Promise()
      r = Promise()
      p.done_all()
      p.done_all([(inc, dec)])
      p.done_all(
          [
              (inc, dec),
              (inc, dec),
              {"success": inc, "failure": dec},
              lambda _: r.do_resolve(None),
          ]
      )
      p.do_resolve(4)
      Promise.wait(r)
      assert counter[0] == 4
  
      p = Promise()
      r = Promise()
      p.done_all()
      p.done_all([inc])
      p.done_all([(inc, dec)])
      p.done_all(
          [
              (inc, dec),
              {"success": inc, "failure": dec},
              (None, lambda _: r.do_resolve(None)),
          ]
      )
      p.do_reject(Exception("Uh oh!"))
      Promise.wait(r)
      assert counter[0] == 1
  
imports: from time import sleep
  from pytest import raises, fixture
  from threading import Event
  from promise import Promise, is_thenable, promisify, promise_for_dict
  from concurrent.futures import Future
  from threading import Thread
  from .utils import assert_exception
label_desc: Use image node_id 19 for calling a global function with example usage: test_done_all() without return types