docstr: Return sorted edges with different strategies.
          
docstr_tok: ["Return","sorted","edges","with","different","strategies","."]
code: def sort_edges(self, edge_index, num_nodes, sort_by="src"):
      """Return sorted edges with different strategies."""
      if sort_by not in ["src", "dst"]:
          raise ValueError("sort_by should be in 'src' or 'dst'.")
  
      if sort_by == "src":
          u = edge_index[:, 0]
          v = edge_index[:, 1]
          self.get_sparse_edge_info(u, v, num_nodes)
          src, dst, eid = (
              self._sorted_u,
              self._sorted_v,
              self._sorted_eid,
          )
      if sort_by == "dst":
          v = edge_index[:, 0]
          u = edge_index[:, 1]
          self.get_sparse_edge_info(u, v, num_nodes)
          dst, src, eid = (
              self._sorted_u,
              self._sorted_v,
              self._sorted_eid,
          )
      return src, dst, eid
  
file_path: PGL/examples/gnn_depoly/models/base_conv.py
imports: import pdb
  import paddle
  import paddle.nn
  from pgl.utils import op
  from pgl.message import Message
  from pgl.utils.helper import unique_segment
label_desc: Use image node_id 5 for calling the BaseConv obj's underlying member method code with example usage: obj.sort_edges(edge_index, num_nodes, sort_by) and returns: src,  dst,  eid