code: def weakly_connected_components(G):
      G = _to_directed_graph(G)
      return _connected_components(G, symmetrize="union")
  
imports: from nx_cugraph.convert import _to_directed_graph
  from nx_cugraph.utils import networkx_algorithm, not_implemented_for
  from .connected import _connected_components, _is_connected, _number_connected_components
label_desc: Use image node_id 1 for calling a global function with example usage: weakly_connected_components(G) and returns: _connected_components