code: def _sort_edge_indices(self, primary="src"):
      # DRY warning: see also MultiGraph._sort_edge_indices
      if primary == "src":
          stacked = cp.vstack((self.dst_indices, self.src_indices))
      elif primary == "dst":
          stacked = cp.vstack((self.src_indices, self.dst_indices))
      else:
          raise ValueError(
              f'Bad `primary` argument; expected "src" or "dst", got {primary!r}'
          )
      indices = cp.lexsort(stacked)
      if (cp.diff(indices) > 0).all():
          # Already sorted
          return
      self.src_indices = self.src_indices[indices]
      self.dst_indices = self.dst_indices[indices]
      self.edge_values.update(
          {key: val[indices] for key, val in self.edge_values.items()}
      )
      self.edge_masks.update(
          {key: val[indices] for key, val in self.edge_masks.items()}
      )
  
imports: from __future__ import annotations
  import operator
  from copy import deepcopy
  from typing import TYPE_CHECKING
  import cupy
  import networkx
  import numpy
  import pylibcugraph
  import nx_cugraph
  from ..utils import index_dtype
label_desc: Use image node_id 36 for calling the Graph obj's underlying member method code with example usage: obj._sort_edge_indices(primary) without return types