code: def test_cycles(self):
      K_undir = nx.all_pairs_node_connectivity(self.cycle)
      for source in K_undir:
          for target, k in K_undir[source].items():
              assert k == 2
      K_dir = nx.all_pairs_node_connectivity(self.directed_cycle)
      for source in K_dir:
          for target, k in K_dir[source].items():
              assert k == 1
  
imports: import itertools
  import pytest
  import networkx
  from networkx.algorithms import flow
  from networkx.algorithms.connectivity import local_edge_connectivity, local_node_connectivity
label_desc: Use image node_id 2 for calling the TestAllPairsNodeConnectivity obj's underlying member method code with example usage: obj.test_cycles() without return types