code: def test_from_networkx_errors():
      het = nx.MultiDiGraph()
      het.add_nodes_from([(0, {"n": "a"}), (1, {"n": "b"})])
  
      with pytest.raises(TypeError, match="more than one node type"):
          from_networkx_for_testing(het, node_features=pd.DataFrame())
  
      with pytest.raises(
          ValueError, match=r"\['a'\]:.*: missing from data \(0\)$"
      ):
          from_networkx_for_testing(
              het,
              node_features={"a": pd.DataFrame(), "b": pd.DataFrame()},
          )
  
      with pytest.raises(
          ValueError, match=r"\['a'\]:.*: extra in data \(1\)$"
      ):
          from_networkx_for_testing(
              het,
              node_features={
                  "a": pd.DataFrame(index=[0, 1]),
                  "b": pd.DataFrame(),
              },
          )
  
      with pytest.raises(
          ValueError,
          match=r"\['a'\]:.*: missing from data \(0\) and extra in data \(1\)$",
      ):
          from_networkx_for_testing(
              het,
              node_features={
                  "a": pd.DataFrame(index=[1]),
                  "b": pd.DataFrame(),
              },
          )
  
      with pytest.raises(
          TypeError, match=r"\['a'\]: .*, found NoneType"
      ):
          from_networkx_for_testing(het, node_features={"a": None})
  
      attrs = nx.DiGraph()
      attrs.add_nodes_from([(0, {"f": [1]}), (1, {"f": [2, 3]})])
      with pytest.raises(
          ValueError,
          match="of type 'a' to have feature dimension 1, found dimension 2",
      ):
          from_networkx_for_testing(attrs, node_features="f")
  
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 28 for calling a global function with example usage: test_from_networkx_errors() without return types