code: def all_gather(data, group=None):
      """
      Run all_gather on arbitrary picklable data (not necessarily tensors).
  
      Args:
          data: any picklable object
          group: a torch process group. By default, will use a group which
              contains all ranks on gloo backend.
  
      Returns:
          list[data]: list of data gathered from each rank
      """
      if get_world_size() == 1:
          return [data]
      if group is None:
          group = (
              _get_global_gloo_group()
          )  # use CPU group by default, to reduce GPU RAM usage.
      world_size = dist.get_world_size(group)
      if world_size == 1:
          return [data]
  
      output = [None for _ in range(world_size)]
      dist.all_gather_object(output, data, group=group)
      return output
  
file_path: detectron2/detectron2/utils/comm.py
imports: import functools
  import numpy
  import torch
  import torch.distributed
label_desc: Use image node_id 10 for calling a global function with example usage: all_gather(data, group) and returns: output, list, list