code: def __call__(self, fs):
      pending = _collections.defaultdict(list)
      for index, item in enumerate(fs):
          pending[item].append(index)
      if pending:
          self.future = future = next(iter(pending)).__class__()
          self.result = [None] * sum(map(len, pending.values()))
          self.pending = pending
          future.add_done_callback(self._done_cb)
          for item in list(pending):
              item.add_done_callback(self._item_cb)
      else:
          future = _base.Future()
          future.set_result([])
      return future
  
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 2 for calling the _Collect obj's underlying member method code with example usage: obj.__call__(fs) and returns: future