code: def test_edge_attribute_discard():
      # Test that edge attributes are discarded if we do not specify to keep them
      G = nx.Graph()
  
      edgelist = [
          (0, 1, [("weight", 5), ("otherattr", 1), ("otherattr2", 3)]),
          (0, 2, [("weight", 5), ("otherattr", 2), ("otherattr2", 2)]),
          (1, 2, [("weight", 6), ("otherattr", 3), ("otherattr2", 1)]),
      ]
      G.add_edges_from(edgelist)
  
      B = branchings.maximum_branching(G, preserve_attrs=False)
  
      edge_dict = B[0][1]
      with pytest.raises(KeyError):
          _ = edge_dict["otherattr"]
  
imports: import math
  from operator import itemgetter
  import pytest
  import networkx
  from networkx.algorithms.tree import branchings, recognition
label_desc: Use image node_id 33 for calling a global function with example usage: test_edge_attribute_discard() without return types