code: def test_to_numpy_array_structured_dtype_multiple_fields(
      graph_type, edge
  ):
      G = graph_type([edge])
      dtype = np.dtype(
          [("weight", float), ("cost", float), ("flow", float)]
      )
      A = nx.to_numpy_array(G, dtype=dtype, weight=None)
      for attr in dtype.names:
          expected = nx.to_numpy_array(G, dtype=float, weight=attr)
          npt.assert_array_equal(A[attr], expected)
  
imports: import pytest
  import networkx
  from networkx.generators.classic import barbell_graph, cycle_graph, path_graph
  from networkx.utils import graphs_equal
label_desc: Use image node_id 10 for calling a global function with example usage: test_to_numpy_array_structured_dtype_multiple_fields(graph_type, edge) without return types