code: def _test_graph_chain_collapse(self, g, g2):
      assert len(g._nodes) == len(
          g2._nodes
      )  # now we don't drop any since we write to FINAL columns instead. so nodes table will be same
      assert len(g._edges) >= len(g2._edges)
      assert (
          g2._nodes.astype(str).to_dict() == collapse_all_nodes
      ), "chained collapsed nodes dataframe.astype(str) should match collapsed nodes df"
      assert (
          g2._edges.astype(str).to_dict() == collapse_all_edges
      ), "chained collapsed edges dataframe.astype(str) should match collapsed edges df"
  
file_path: pygraphistry/graphistry/tests/test_compute_collapse.py
imports: import pandas
  from common import NoAuthTestCase
  from graphistry.tests.test_compute import CGFull
label_desc: Use image node_id 2 for calling the TestCollapse obj's underlying member method code with example usage: obj._test_graph_chain_collapse(g, g2) without return types