code: def eye(
      n_rows: int,
      n_cols: Optional[int] = None,
      /,
      *,
      k: int = 0,
      dtype: Optional[Dtype] = None,
      device: Optional[Device] = None,
  ) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.eye <numpy.eye>`.
  
      See its docstring for more information.
      """
      from ._array_object import Array
  
      _check_valid_dtype(dtype)
      if device is not None and not isinstance(device, _Device):
          raise ValueError(f"Unsupported device {device!r}")
      if device is None:
          device = _Device()  # current device
      prev_device = runtime.getDevice()
      try:
          runtime.setDevice(device.id)
          return Array._new(np.eye(n_rows, M=n_cols, k=k, dtype=dtype))
      finally:
          runtime.setDevice(prev_device)
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, List, Optional, Tuple, Union
  from ._dtypes import _all_dtypes
  import cupy
  from cupy.cuda import Device
  from cupy_backends.cuda.api import runtime
label_desc: Use image node_id 6 for calling a global function with example usage: eye() and returns: Array