code: def test_optimal_arborescence2():
      G = build_branching(optimal_arborescence_2)
      assert recognition.is_arborescence(G), True
      assert branchings.branching_weight(G) == 51
  
imports: import math
  from operator import itemgetter
  import pytest
  import networkx
  from networkx.algorithms.tree import branchings, recognition
label_desc: Use image node_id 9 for calling a global function with example usage: test_optimal_arborescence2() without return types