code: def all_gather(data):
      """
      收集各个进程中的数据
      Run all_gather on arbitrary picklable data (not necessarily tensors)
      Args:
          data: any picklable object
      Returns:
          list[data]: list of data gathered from each rank
      """
      world_size = get_world_size()  # 进程数
      if world_size == 1:
          return [data]
  
      data_list = [None] * world_size
      dist.all_gather_object(data_list, data)
  
      return data_list
  
imports: from collections import defaultdict, deque
  import datetime
  import pickle
  import time
  import errno
  import os
  import torch
  import torch.distributed
label_desc: Use image node_id 1 for calling a global function with example usage: all_gather(data) and returns: data_list, list