code: def test_to_numpy_array_complex_weights(G, expected):
      G.add_edge(0, 1, weight=1 + 2j)
      A = nx.to_numpy_array(G, dtype=complex)
      npt.assert_array_equal(A, 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 4 for calling a global function with example usage: test_to_numpy_array_complex_weights(G, expected) without return types