code: def test_sparse_coo_tensor_from_dense(dtype_str, arrow_type):
      dtype = np.dtype(dtype_str)
      expected_data = np.array([[8, 2, 5, 3, 4, 6]]).T.astype(dtype)
      expected_coords = np.array(
          [
              [0, 0, 1, 2, 3, 3],
              [0, 2, 5, 0, 4, 5],
          ]
      ).T
      array = np.array(
          [
              [8, 0, 2, 0, 0, 0],
              [0, 0, 0, 0, 0, 5],
              [3, 0, 0, 0, 0, 0],
              [0, 0, 0, 0, 4, 6],
          ]
      ).astype(dtype)
      tensor = pa.Tensor.from_numpy(array)
  
      # Test from numpy array
      sparse_tensor = pa.SparseCOOTensor.from_dense_numpy(array)
      repr(sparse_tensor)
      result_data, result_coords = sparse_tensor.to_numpy()
      assert sparse_tensor.type == arrow_type
      assert np.array_equal(expected_data, result_data)
      assert np.array_equal(expected_coords, result_coords)
  
      # Test from Tensor
      sparse_tensor = pa.SparseCOOTensor.from_tensor(tensor)
      repr(sparse_tensor)
      result_data, result_coords = sparse_tensor.to_numpy()
      assert sparse_tensor.type == arrow_type
      assert np.array_equal(expected_data, result_data)
      assert np.array_equal(expected_coords, result_coords)
  
imports: import pytest
  import sys
  import weakref
  import numpy
  import pyarrow
label_desc: Use image node_id 6 for calling a global function with example usage: test_sparse_coo_tensor_from_dense(dtype_str, arrow_type) without return types