code: def _check_connectivity(G):
      result = k_components(G)
      for k, components in result.items():
          if k < 3:
              continue
          for component in components:
              C = G.subgraph(component)
              K = nx.node_connectivity(C)
              assert K >= k
  
imports: import pytest
  import networkx
  from networkx.algorithms.approximation import k_components
  from networkx.algorithms.approximation.kcomponents import _AntiGraph, _same
label_desc: Use image node_id 4 for calling a global function with example usage: _check_connectivity(G) without return types