code: def setup_class(cls):
      cls.gc = []
      G = nx.DiGraph()
      G.add_edges_from(
          [
              (1, 2),
              (2, 3),
              (2, 8),
              (3, 4),
              (3, 7),
              (4, 5),
              (5, 3),
              (5, 6),
              (7, 4),
              (7, 6),
              (8, 1),
              (8, 7),
          ]
      )
      C = [[3, 4, 5, 7], [1, 2, 8], [6]]
      cls.gc.append((G, C))
  
      G = nx.DiGraph()
      G.add_edges_from([(1, 2), (1, 3), (1, 4), (4, 2), (3, 4), (2, 3)])
      C = [[2, 3, 4], [1]]
      cls.gc.append((G, C))
  
      G = nx.DiGraph()
      G.add_edges_from([(1, 2), (2, 3), (3, 2), (2, 1)])
      C = [[1, 2, 3]]
      cls.gc.append((G, C))
  
      # Eppstein's tests
      G = nx.DiGraph(
          {
              0: [1],
              1: [2, 3],
              2: [4, 5],
              3: [4, 5],
              4: [6],
              5: [],
              6: [],
          }
      )
      C = [[0], [1], [2], [3], [4], [5], [6]]
      cls.gc.append((G, C))
  
      G = nx.DiGraph({0: [1], 1: [2, 3, 4], 2: [0, 3], 3: [4], 4: [3]})
      C = [[0, 1, 2], [3, 4]]
      cls.gc.append((G, C))
  
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 1 for calling the TestWeaklyConnected obj's underlying member method code with example usage: obj.setup_class(cls) without return types