code: def allgather_object(
      obj, session=None, name=None, process_set=global_process_set
  ):
      """
      Serializes and allgathers an object from all other processes.
  
      Arguments:
          obj: An object capable of being serialized without losing any context.
          session: Session for TensorFlow v1 compatibility.
          name: Optional name to use during allgather, will default to the class
                type.
          process_set: Process set object to limit this operation to a subset of
                       Horovod processes. Default is the global process set.
  
      Returns:
          The list of objects that were allgathered across all ranks.
      """
      if name is None:
          name = type(obj).__name__
  
      def load(byte_array):
          buf = io.BytesIO(byte_array.tobytes())
          return cloudpickle.load(buf)
  
      def to_numpy(v):
          if not _executing_eagerly():
              sess = session or ops.get_default_session()
              return sess.run(v)
          else:
              return v.numpy()
  
      b = io.BytesIO()
      cloudpickle.dump(obj, b)
  
      t = tf.convert_to_tensor(bytearray(b.getvalue()), dtype=tf.uint8)
      sz = tf.convert_to_tensor([t.shape[0]], dtype=tf.int32)
  
      sizes = to_numpy(
          allgather(sz, name=name + ".sz", process_set=process_set)
      )
      gathered = to_numpy(
          allgather(t, name=name + ".t", process_set=process_set)
      )
  
      def select(i):
          start = sum(sizes[:i])
          end = start + sizes[i]
          return gathered[start:end]
  
      return [load(select(i)) for i in range(process_set.size())]
  
file_path: horovod/horovod/tensorflow/functions.py
imports: import io
  import cloudpickle
  import numpy
  import tensorflow
  from tensorflow.python.framework import ops
  from horovod.tensorflow.mpi_ops import allgather, broadcast, broadcast_
  from horovod.tensorflow.mpi_ops import rank, size
  from horovod.tensorflow.util import _cache, _executing_eagerly, _make_subgraph
  from horovod.common.process_sets import ProcessSet, global_process_set
label_desc: Use image node_id 6 for calling a global function with example usage: allgather_object(obj, session, name, process_set) and returns: unknown, cloudpickle, gathered, sess, v