code: def _to_networkx_homogeneous(g, node_attrs, edge_attrs):
      # TODO: consider adding an eid_attr parameter as in
      #  `_to_networkx_heterogeneous` when this function is properly tested
      # (see GitHub issue #5735)
      src, dst = g.edges()
      src = F.asnumpy(src)
      dst = F.asnumpy(dst)
      # xiangsx: Always treat graph as multigraph
      nx_graph = nx.MultiDiGraph()
      nx_graph.add_nodes_from(range(g.num_nodes()))
      for eid, (u, v) in enumerate(zip(src, dst)):
          nx_graph.add_edge(u, v, id=eid)
  
      if node_attrs is not None:
          for nid, attr in nx_graph.nodes(data=True):
              feat_dict = g._get_n_repr(0, nid)
              attr.update(
                  {
                      key: F.squeeze(feat_dict[key], 0)
                      for key in node_attrs
                  }
              )
      if edge_attrs is not None:
          for _, _, attr in nx_graph.edges(data=True):
              eid = attr["id"]
              feat_dict = g._get_e_repr(0, eid)
              attr.update(
                  {
                      key: F.squeeze(feat_dict[key], 0)
                      for key in edge_attrs
                  }
              )
      return nx_graph
  
imports: from collections import defaultdict
  from collections.abc import Mapping
  import networkx
  import numpy
  from scipy.sparse import spmatrix
  from .None import backend, graph_index, heterograph_index, utils
  from .base import DGLError, EID, ETYPE, NID, NTYPE
  from .heterograph import combine_frames, DGLBlock, DGLGraph
label_desc: Use image node_id 13 for calling a global function with example usage: _to_networkx_homogeneous(g, node_attrs, edge_attrs) and returns: nx_graph