code: def _item_cb(self, item):
      with self.lock:
          future = self.future
          result = self.result
          pending = self.pending
          if future is None:
              return
          if item.cancelled():
              future.cancel()
              return
          if item.exception() is not None:
              if (
                  future.set_running_or_notify_cancel()
              ):  # pragma: no branch
                  future.set_exception(item.exception())
              return
          for index in pending.pop(item):
              result[index] = item.result()
          if not pending:
              if (
                  future.set_running_or_notify_cancel()
              ):  # pragma: no branch
                  future.set_result(result)
  
file_path: mpi4py/src/mpi4py/futures/util.py
imports: import collections
  import functools
  import threading
  from .None import _base
label_desc: Use image node_id 3 for calling the _Collect obj's underlying member method code with example usage: obj._item_cb(item) without return types