code: def _high_degree_components(G, k):
      """Helper for filtering components that can't be k-edge-connected.
  
      Removes and generates each node with degree less than k.  Then generates
      remaining components where all nodes have degree at least k.
      """
      # Iteratively remove parts of the graph that are not k-edge-connected
      H = G.copy()
      singletons = set(_low_degree_nodes(H, k))
      while singletons:
          # Only search neighbors of removed nodes
          nbunch = set(
              it.chain.from_iterable(map(H.neighbors, singletons))
          )
          nbunch.difference_update(singletons)
          H.remove_nodes_from(singletons)
          for node in singletons:
              yield {node}
          singletons = set(_low_degree_nodes(H, k, nbunch))
  
      # Note: remaining connected components may not be k-edge-connected
      if G.is_directed():
          yield from nx.strongly_connected_components(H)
      else:
          yield from nx.connected_components(H)
  
file_path: networkx/networkx/algorithms/connectivity/edge_kcomponents.py
imports: import itertools
  from functools import partial
  import networkx
  from networkx.utils import arbitrary_element, not_implemented_for
label_desc: Use image node_id 6 for calling a global function with example usage: _high_degree_components(G, k) without return types