docs: def _connected(cm, nodes, connection):
      """Test connectivity for the connectivity matrix."""
      if nodes is not None:
          cm = cm[np.ix_(nodes, nodes)]
  
      num_components, _ = connected_components(cm, connection=connection)
      return num_components < 2