code: def is_connected(G):
      """Returns True if the graph is connected, False otherwise.
  
      Parameters
      ----------
      G : NetworkX Graph
         An undirected graph.
  
      Returns
      -------
      connected : bool
        True if the graph is connected, false otherwise.
  
      Raises
      ------
      NetworkXNotImplemented
          If G is directed.
  
      Examples
      --------
      >>> G = nx.path_graph(4)
      >>> print(nx.is_connected(G))
      True
  
      See Also
      --------
      is_strongly_connected
      is_weakly_connected
      is_semiconnected
      is_biconnected
      connected_components
  
      Notes
      -----
      For undirected graphs only.
  
      """
      if len(G) == 0:
          raise nx.NetworkXPointlessConcept(
              "Connectivity is undefined for the null graph."
          )
      return sum(
          1 for node in _plain_bfs(G, arbitrary_element(G))
      ) == len(G)
  
file_path: networkx/networkx/algorithms/components/connected.py
imports: import networkx
  from networkx.utils.decorators import not_implemented_for
  from ...utils import arbitrary_element
label_desc: Use image node_id 3 for calling a global function with example usage: is_connected(G) and returns: unknown