code: def drain_queue_until_resolved(self, promise):
      # type: (Promise) -> None
      from .promise import Promise
  
      queue = self.normal_queue
      while queue:
          if not promise.is_pending:
              return
          fn = queue.popleft()
          if isinstance(fn, Promise):
              fn._settle_promises()
              continue
          fn()
  
      self.reset()
      self.have_drained_queues = True
      self.drain_queue(self.late_queue)
  
imports: from collections import deque
  from threading import local
label_desc: Use image node_id 13 for calling the Async obj's underlying member method code with example usage: obj.drain_queue_until_resolved(promise) without return types