code: def validate_gomory_hu_tree(self, g, t):
      n = g.vcount()
  
      self.assertEqual(n, t.vcount())
      self.assertEqual(n - 1, t.ecount())
      self.assertFalse(t.is_directed())
  
      if "capacity" in g.edge_attributes():
          capacities = g.es["capacity"]
      else:
          capacities = None
  
      for i, j in combinations(list(range(n)), 2):
          path = t.get_shortest_paths(i, j, output="epath")
          if path:
              path = path[0]
              expected_flow = min(t.es[path]["flow"])
              observed_flow = g.maxflow_value(i, j, capacities)
              self.assertEqual(observed_flow, expected_flow)
  
imports: import unittest
  from igraph import Cut, Graph, EdgeSeq, InternalError
  from itertools import combinations
  from random import randint
label_desc: Use image node_id 5 for calling the GomoryHuTests obj's underlying member method code with example usage: obj.validate_gomory_hu_tree(g, t) without return types