docstr: Gathers tensors from all parties in a list.
docstr_tok: ["Gathers","tensors","from","all","parties","in","a","list","."]
code: def all_gather(self, tensor, async_op=False):
      """Gathers tensors from all parties in a list."""
      if async_op:
          raise NotImplementedError()
  
      for i in range(self.world_size):
          self.mailbox[i].put((self.rank, tensor.clone()))
  
      self.barrier.wait()
  
      result = sorted(
          (
              self.mailbox[self.rank].get()
              for _ in range(self.world_size)
          ),
          key=itemgetter(0),
      )
  
      return [tensor for (rank, tensor) in result]
  
imports: import logging
  import threading
  from operator import itemgetter
  from queue import Queue
  import torch
  from torch.distributed import ReduceOp
  from .communicator import Communicator
label_desc: Use image node_id 15 for calling the InProcessCommunicator obj's underlying member method code with example usage: obj.all_gather(tensor, async_op) and returns: unknown