code: def test_connected_mutability(self):
      DG = nx.path_graph(5, create_using=nx.DiGraph)
      G = nx.disjoint_union(DG, DG)
      seen = set()
      for component in nx.weakly_connected_components(G):
          assert len(seen & component) == 0
          seen.update(component)
          component.clear()
  
file_path: networkx/networkx/algorithms/components/tests/test_weakly_connected.py
imports: import pytest
  import networkx
  from networkx import NetworkXNotImplemented
label_desc: Use image node_id 7 for calling the TestWeaklyConnected obj's underlying member method code with example usage: obj.test_connected_mutability() without return types