code: def gather_metadata_json(metadata, rank, world_size):
      """
      Gather an object (json schema on `rank`)
      Parameters:
      -----------
      metadata : json dictionary object
          json schema formed on each rank with graph level data.
          This will be used as input to the distributed training in the later steps.
      Returns:
      --------
      list : list of json dictionary objects
          The result of the gather operation, which is the list of json dicitonary
          objects from each rank in the world
      """
  
      # Populate input obj and output obj list on rank-0 and non-rank-0 machines
      input_obj = None if rank == 0 else metadata
      output_objs = (
          [None for _ in range(world_size)] if rank == 0 else None
      )
  
      # invoke the gloo method to perform gather on rank-0
      dist.gather_object(input_obj, output_objs, dst=0)
      return output_objs
  
imports: import numpy
  import torch
  import torch.distributed
label_desc: Use image node_id 4 for calling a global function with example usage: gather_metadata_json(metadata, rank, world_size) and returns: output_objs