code: def test_identity(self):
      assert_equal(construct.identity(1).toarray(), [[1]])
      assert_equal(construct.identity(2).toarray(), [[1, 0], [0, 1]])
  
      I = construct.identity(3, dtype="int8", format="dia")
      assert_equal(I.dtype, np.dtype("int8"))
      assert_equal(I.format, "dia")
  
      for fmt in sparse_formats:
          I = construct.identity(3, format=fmt)
          assert_equal(I.format, fmt)
          assert_equal(I.toarray(), [[1, 0, 0], [0, 1, 0], [0, 0, 1]])
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  from numpy import array
  from numpy.testing import assert_equal, assert_, assert_array_equal, assert_array_almost_equal_nulp
  import pytest
  from pytest import raises
  from scipy._lib._testutils import check_free_memory
  from scipy.sparse import csr_matrix, coo_matrix, construct
  from scipy.sparse.construct import rand
  from scipy.sparse.sputils import matrix
label_desc: Use image node_id 10 for calling the TestConstructUtils obj's underlying member method code with example usage: obj.test_identity() without return types