code: def test_field_from_coo_matrix():
      import scipy.sparse as sps
  
      V = 10
      a = np.random.rand(V, V) > 0.9
      fi = field_from_coo_matrix_and_data(sps.coo_matrix(a), a)
      assert fi.E == a.sum()
  
imports: import numpy
  import numpy.random
  from numpy.testing import assert_array_equal
  from ..field import field_from_coo_matrix_and_data, field_from_graph_and_data
  from ..graph import wgraph_from_3d_grid
label_desc: Use image node_id 31 for calling a global function with example usage: test_field_from_coo_matrix() without return types