code: def test_to_numpy_array_structured_dtype_single_attr_default():
      G = nx.path_graph(3)
      dtype = np.dtype([("weight", float)])  # A single named field
      A = nx.to_numpy_array(G, dtype=dtype, weight=None)
      expected = np.array(
          [[0, 1, 0], [1, 0, 1], [0, 1, 0]], dtype=float
      )
      npt.assert_array_equal(A["weight"], 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 8 for calling a global function with example usage: test_to_numpy_array_structured_dtype_single_attr_default() without return types