code: def test_from_spmatrix(self, format, labels, dtype):
      sp_sparse = pytest.importorskip("scipy.sparse")
  
      sp_dtype = SparseDtype(dtype, np.array(0, dtype=dtype).item())
  
      mat = sp_sparse.eye(10, format=format, dtype=dtype)
      result = pd.DataFrame.sparse.from_spmatrix(
          mat, index=labels, columns=labels
      )
      expected = pd.DataFrame(
          np.eye(10, dtype=dtype), index=labels, columns=labels
      ).astype(sp_dtype)
      tm.assert_frame_equal(result, expected)
  
imports: import string
  import numpy
  import pytest
  import pandas
  from pandas import SparseDtype
  import pandas._testing
  from pandas.core.arrays.sparse import SparseArray
label_desc: Use image node_id 2 for calling the TestFrameAccessor obj's underlying member method code with example usage: obj.test_from_spmatrix(format, labels, dtype) without return types