code: def _strongly_connected_components(M):
      """Returns the list of strongly connected vertices of the graph when
      a square matrix is viewed as a weighted graph.
  
      Examples
      ========
  
      >>> from sympy import Matrix
      >>> A = Matrix([
      ...     [44, 0, 0, 0, 43, 0, 45, 0, 0],
      ...     [0, 66, 62, 61, 0, 68, 0, 60, 67],
      ...     [0, 0, 22, 21, 0, 0, 0, 20, 0],
      ...     [0, 0, 12, 11, 0, 0, 0, 10, 0],
      ...     [34, 0, 0, 0, 33, 0, 35, 0, 0],
      ...     [0, 86, 82, 81, 0, 88, 0, 80, 87],
      ...     [54, 0, 0, 0, 53, 0, 55, 0, 0],
      ...     [0, 0, 2, 1, 0, 0, 0, 0, 0],
      ...     [0, 76, 72, 71, 0, 78, 0, 70, 77]])
      >>> A.strongly_connected_components()
      [[0, 4, 6], [2, 3, 7], [1, 5, 8]]
      """
      if not M.is_square:
          raise NonSquareMatrixError
  
      # RepMatrix uses the more efficient DomainMatrix.scc() method
      rep = getattr(M, "_rep", None)
      if rep is not None:
          return rep.scc()
  
      V = range(M.rows)
      E = sorted(M.todok().keys())
      return strongly_connected_components((V, E))
  
imports: from sympy.utilities.iterables import flatten, connected_components, strongly_connected_components
  from .exceptions import NonSquareMatrixError
label_desc: Use image node_id 2 for calling a global function with example usage: _strongly_connected_components(M) and returns: strongly_connected_components, rep