code: def test_k_core(self):
      # k=0
      k_core_subgraph = nx.k_core(self.H, k=0)
      assert sorted(k_core_subgraph.nodes()) == sorted(self.H.nodes())
      # k=1
      k_core_subgraph = nx.k_core(self.H, k=1)
      assert sorted(k_core_subgraph.nodes()) == [1, 2, 3, 4, 5, 6]
      # k = 2
      k_core_subgraph = nx.k_core(self.H, k=2)
      assert sorted(k_core_subgraph.nodes()) == [2, 4, 5, 6]
  
imports: import pytest
  import networkx
  from networkx.utils import nodes_equal
label_desc: Use image node_id 9 for calling the TestCore obj's underlying member method code with example usage: obj.test_k_core() without return types