def _core_subgraph(G, k_filter, k=None, core=None):
 if (core is None):
  core = core_number(G)
 if (k is None):
  k = max(core.values())
 nodes = (v for v in core if k_filter(v, k, core))
 return G.subgraph(nodes).copy()

def _core_subgraph ( G , k_filter , k = None , core = None ) : if ( core is None ) : core = core_number ( G ) if ( k is None ) : k = max ( core . values ( ) ) nodes = ( v for v in core if k_filter ( v , k , core ) ) return G . subgraph ( nodes ) . copy ( )
returns the subgraph induced by nodes passing filter k_filter .