code: def _graph_is_connected(graph):
      """Return whether the graph is connected (True) or Not (False).
  
      Parameters
      ----------
      graph : {array-like, sparse matrix} of shape (n_samples, n_samples)
          Adjacency matrix of the graph, non-zero weight means an edge
          between the nodes.
  
      Returns
      -------
      is_connected : bool
          True means the graph is fully connected and False means not.
      """
      if sparse.issparse(graph):
          # sparse graph, find all the connected components
          n_connected_components, _ = connected_components(graph)
          return n_connected_components == 1
      else:
          # dense graph, find all connected components start from node 0
          return (
              _graph_connected_component(graph, 0).sum()
              == graph.shape[0]
          )
  
imports: import warnings
  from numbers import Integral, Real
  import numpy
  from scipy import sparse
  from scipy.linalg import eigh
  from scipy.sparse.csgraph import connected_components
  from scipy.sparse.csgraph import laplacian
  from scipy.sparse.linalg import eigsh, lobpcg
  from ..base import BaseEstimator, _fit_context
  from ..metrics.pairwise import rbf_kernel
  from ..neighbors import NearestNeighbors, kneighbors_graph
  from ..utils import check_array, check_random_state, check_symmetric
  from ..utils._arpack import _init_arpack_v0
  from ..utils._param_validation import Interval, StrOptions
  from ..utils.extmath import _deterministic_vector_sign_flip
label_desc: Use image node_id 2 for calling a global function with example usage: _graph_is_connected(graph) and returns: unknown, unknown