code: def test_greedy_max3():
      # All equal weights.
      #
      G = G1()
      B = branchings.greedy_branching(G, attr=None)
  
      # This is mostly arbitrary...the output was generated by running the algo.
      edges = [
          (2, 1, 1),
          (3, 0, 1),
          (3, 4, 1),
          (5, 8, 1),
          (6, 2, 1),
          (7, 3, 1),
          (7, 6, 1),
          (8, 7, 1),
      ]
      B_ = build_branching(edges)
      assert_equal_branchings(B, B_, default=1)
  
imports: import math
  from operator import itemgetter
  import pytest
  import networkx
  from networkx.algorithms.tree import branchings, recognition
label_desc: Use image node_id 16 for calling a global function with example usage: test_greedy_max3() without return types