code: def test_from_networkx_ignore_unknown_attrs():
      raw_nodes = [(0, {"foo": 123})]
      raw_edges = [(0, 0, {"bar": 456})]
      expected_nodes = {"a": pd.DataFrame(columns=range(0), index=[0])}
      expected_edges = {
          "x": pd.DataFrame(
              [(0, 0)], columns=["source", "target"], index=[0]
          ).assign(w=W)
      }
  
      g = nx.MultiDiGraph()
      g.add_nodes_from(raw_nodes)
      g.add_edges_from(raw_edges)
      nodes, edges = from_networkx_for_testing(g)
      assert_dataframe_dict_equal(nodes, expected_nodes)
      assert_dataframe_dict_equal(edges, expected_edges)
  
imports: import networkx
  import numpy
  import pandas
  import pytest
  from stellargraph.core.convert import ColumnarConverter, convert_nodes, convert_edges, from_networkx
  from stellargraph.core.indexed_array import IndexedArray
label_desc: Use image node_id 21 for calling a global function with example usage: test_from_networkx_ignore_unknown_attrs() without return types