code: def eye_sparse_matrix(N, M=None, k=0, dtype=float, gpu=False):
      m = sps if not gpu else cps
      return SparseMatrix(m.eye(N, n=M, k=k, dtype=dtype, format="csr"))
  
imports: import numpy
  from collections.abc import Iterable
  from typing import List
  from .core import issparse, get_array_module, cp, cps, get_sparse_module, naked, sps, splinalg
  from .array import SparseNDArray, SparseArray
label_desc: Use image node_id 3 for calling a global function with example usage: eye_sparse_matrix(N, M, k, dtype, gpu) and returns: SparseMatrix