code: def test_digraph2(self):
      # Example from ticket #430 from mfrasca. Original source:
      # http://www.cs.princeton.edu/courses/archive/spr03/cs226/lectures/mincost.4up.pdf, slide 11.
      G = nx.DiGraph()
      G.add_edge("s", 1, capacity=12)
      G.add_edge("s", 2, capacity=6)
      G.add_edge("s", 3, capacity=14)
      G.add_edge(1, 2, capacity=11, weight=4)
      G.add_edge(2, 3, capacity=9, weight=6)
      G.add_edge(1, 4, capacity=5, weight=5)
      G.add_edge(1, 5, capacity=2, weight=12)
      G.add_edge(2, 5, capacity=4, weight=4)
      G.add_edge(2, 6, capacity=2, weight=6)
      G.add_edge(3, 6, capacity=31, weight=3)
      G.add_edge(4, 5, capacity=18, weight=4)
      G.add_edge(5, 6, capacity=9, weight=5)
      G.add_edge(4, "t", capacity=3)
      G.add_edge(5, "t", capacity=7)
      G.add_edge(6, "t", capacity=22)
      flow = nx.max_flow_min_cost(G, "s", "t")
      soln = {
          1: {2: 6, 4: 5, 5: 1},
          2: {3: 6, 5: 4, 6: 2},
          3: {6: 20},
          4: {5: 2, "t": 3},
          5: {6: 0, "t": 7},
          6: {"t": 22},
          "s": {1: 12, 2: 6, 3: 14},
          "t": {},
      }
      assert flow == soln
  
      G.add_edge("t", "s", weight=-100)
      flowCost, flow = nx.capacity_scaling(G)
      G.remove_edge("t", "s")
      assert flow["t"]["s"] == 32
      assert flowCost == -3007
      del flow["t"]["s"]
      assert flow == soln
      assert nx.cost_of_flow(G, flow) == 193
  
imports: import bz2
  import importlib.resources
  import os
  import pickle
  import pytest
  import networkx
label_desc: Use image node_id 8 for calling the TestMinCostFlow obj's underlying member method code with example usage: obj.test_digraph2() without return types