code: def identity(n, dtype=None):
      """
      Returns the square identity matrix of given size.
  
      Parameters
      ----------
      n : int
          Size of the returned identity matrix.
      dtype : data-type, optional
          Data-type of the output. Defaults to ``float``.
  
      Returns
      -------
      out : matrix
          `n` x `n` matrix with its main diagonal set to one,
          and all other elements zero.
  
      See Also
      --------
      numpy.identity : Equivalent array function.
      matlib.eye : More general matrix identity function.
  
      Examples
      --------
      >>> import numpy.matlib
      >>> np.matlib.identity(3, dtype=int)
      matrix([[1, 0, 0],
              [0, 1, 0],
              [0, 0, 1]])
  
      """
      a = array([1] + n * [0], dtype=dtype)
      b = empty((n, n), dtype=dtype)
      b.flat = a
      return b
  
file_path: catboost/contrib/python/numpy/py3/numpy/matlib.py
imports: import warnings
  import numpy
  from numpy.matrixlib.defmatrix import matrix, asmatrix
  from numpy import *
label_desc: Use image node_id 4 for calling a global function with example usage: identity(n, dtype) and returns: b