code: def test_barbell():
      G = nx.barbell_graph(3, 0)
      partition = [{0, 1, 2}, {3, 4, 5}]
      M = nx.quotient_graph(G, partition, relabel=True)
      assert nodes_equal(M, [0, 1])
      assert edges_equal(M.edges(), [(0, 1)])
      for n in M:
          assert M.nodes[n]["nedges"] == 3
          assert M.nodes[n]["nnodes"] == 3
          assert M.nodes[n]["density"] == 1
  
imports: import pytest
  import networkx
  from networkx.utils import arbitrary_element, edges_equal, nodes_equal
label_desc: Use image node_id 14 for calling a global function with example usage: test_barbell() without return types