code: def compare_flows_and_cuts(
      G, s, t, solnFlows, solnValue, capacity="capacity"
  ):
      for flow_func in flow_funcs:
          errmsg = f"Assertion failed in function: {flow_func.__name__}"
          R = flow_func(G, s, t, capacity)
          # Test both legacy and new implementations.
          flow_value = R.graph["flow_value"]
          flow_dict = build_flow_dict(G, R)
          assert flow_value == solnValue, errmsg
          validate_flows(
              G, s, t, flow_dict, solnValue, capacity, flow_func
          )
          # Minimum cut
          cut_value, partition = nx.minimum_cut(
              G, s, t, capacity=capacity, flow_func=flow_func
          )
          validate_cuts(
              G, s, t, solnValue, partition, capacity, flow_func
          )
  
imports: import pytest
  import networkx
  from networkx.algorithms.flow import boykov_kolmogorov, build_flow_dict, build_residual_network, dinitz, edmonds_karp, preflow_push, shortest_augmenting_path
label_desc: Use image node_id 4 for calling a global function with example usage: compare_flows_and_cuts(G, s, t, solnFlows, solnValue, capacity) without return types