code: def _all_pairs_connectivity(G, cc, k, memo):
      # Brute force check
      for u, v in it.combinations(cc, 2):
          # Use a memoization dict to save on computation
          connectivity = _memo_connectivity(G, u, v, memo)
          if G.is_directed():
              connectivity = min(
                  connectivity, _memo_connectivity(G, v, u, memo)
              )
          assert connectivity >= k
  
imports: import itertools
  import pytest
  import networkx
  from networkx.algorithms.connectivity import EdgeComponentAuxGraph, bridge_components
  from networkx.algorithms.connectivity.edge_kcomponents import general_k_edge_subgraphs
  from networkx.utils import pairwise
label_desc: Use image node_id 4 for calling a global function with example usage: _all_pairs_connectivity(G, cc, k, memo) without return types