def add_edge_attribute(self, name, padding):
        """Add an edge attribute into GraphBolt partition from edge data.

        Parameters
        ----------
        name : str
            The name of the edge attribute.
        padding : int, optional
            The padding value for the new edge attribute.
        """
        # Sanity checks.
        if not self._use_graphbolt:
            raise DGLError("GraphBolt is not used.")

        # Send add request to main server on the same machine.
        kv_names = [
            (
                self.edges[etype].data[name].kvstore_key
                if name in self.edges[etype].data
                else None
            )
            for etype in self.canonical_etypes
        ]
        rpc.send_request(
            self._client._main_server_id,
            AddEdgeAttributeFromKVRequest(name, kv_names, padding),
        )
        # Wait for the response.
        assert rpc.recv_response()._name == name
        # Send add request to local backup servers.
        for i in range(self._client.group_count - 1):
            server_id = (
                self._client.machine_id * self._client.group_count + i + 1
            )
            rpc.send_request(
                server_id, AddEdgeAttributeFromSharedMemRequest(name)
            )
        # Receive response from local backup servers.
        for _ in range(self._client.group_count - 1):
            response = rpc.recv_response()
            assert response._name == name
        # Add edge attribute from main server's shared memory.
        data = _copy_data_from_shared_mem(
            "__edge__" + name, (self.local_partition.total_num_edges,)
        )
        self.local_partition.add_edge_attribute(name, data)
        # Sync local clients.
        self._client.barrier()

        # Save the edge attribute into state. This is required by separate samplers.
        self._added_edge_attributes.append(name)
Add an edge attribute into GraphBolt partition from edge data.

        Parameters
        ----------
        name : str
            The name of the edge attribute.
        padding : int, optional
            The padding value for the new edge attribute.
        
python/dgl/distributed/dist_graph.py