code: def test_to_dict_of_dicts_with_edgedata_multigraph():
      """Multi edge data overwritten when edge_data != None"""
      G = nx.MultiGraph()
      G.add_edge(0, 1, key="a")
      G.add_edge(0, 1, key="b")
      # Multi edge data lost when edge_data is not None
      expected = {0: {1: 10}, 1: {0: 10}}
      assert nx.to_dict_of_dicts(G, edge_data=10) == expected
  
imports: import pytest
  import networkx
  from networkx.convert import from_dict_of_dicts, from_dict_of_lists, to_dict_of_dicts, to_dict_of_lists, to_networkx_graph
  from networkx.generators.classic import barbell_graph, cycle_graph
  from networkx.utils import edges_equal, graphs_equal, nodes_equal
label_desc: Use image node_id 3 for calling a global function with example usage: test_to_dict_of_dicts_with_edgedata_multigraph() without return types