code: def reorder(edge_index, edge_weight=None, edge_features=None):
      """
      Reorders `edge_index`, `edge_weight`, and `edge_features` according to the row-major
      ordering of `edge_index`.
      :param edge_index: np.array of shape `[n_edges, 2]` (representing rows and columns
      of the adjacency matrix), indices to sort in row-major order.
      :param edge_weight: np.array or None, edge weight to sort according to the new
      order of the indices.
      :param edge_features: np.array or None, edge features to sort according to the new
      order of the indices.
      :return:
          - edge_index: np.array, edge_index sorted in row-major order.
          - edge_weight: If edge_weight is not None, edge_weight sorted according to the
          new order of the indices. Otherwise, None.
          - edge_features: If edge_features is not None, edge_features sorted according to
          the new order of the indices. Otherwise, None.
      """
      sort_idx = np.lexsort(np.flipud(edge_index.T))
      output = [edge_index[sort_idx]]
      if edge_weight is not None:
          output.append(edge_weight[sort_idx])
      if edge_features is not None:
          output.append(edge_features[sort_idx])
  
      return tuple(output)
  
imports: import numpy
  import tensorflow
  from scipy import sparse
label_desc: Use image node_id 1 for calling a global function with example usage: reorder(edge_index, edge_weight, edge_features) and returns: tuple