code: def node_connected_component(G, n):
      # We could also do plain BFS from n
      G = _to_undirected_graph(G)
      node_id = n if G.key_to_id is None else G.key_to_id[n]
      node_ids, labels = plc.weakly_connected_components(
          resource_handle=plc.ResourceHandle(),
          graph=G._get_plc_graph(),
          offsets=None,
          indices=None,
          weights=None,
          labels=None,
          do_expensive_check=False,
      )
      indices = cp.nonzero(node_ids == node_id)[0]
      if indices.size == 0:
          return {n}
      return G._nodearray_to_set(node_ids[labels == labels[indices[0]]])
  
file_path: cugraph/python/nx-cugraph/nx_cugraph/algorithms/components/connected.py
imports: import cupy
  import networkx
  import pylibcugraph
  from nx_cugraph.convert import _to_undirected_graph
  from nx_cugraph.utils import _groupby, networkx_algorithm, not_implemented_for
label_desc: Use image node_id 8 for calling a global function with example usage: node_connected_component(G, n) and returns: G, unknown