code: def eye(N, chunks="auto", M=None, k=0, dtype=float):
      """
      Return a 2-D Array with ones on the diagonal and zeros elsewhere.
  
      Parameters
      ----------
      N : int
        Number of rows in the output.
      chunks : int, str
          How to chunk the array. Must be one of the following forms:
  
          -   A blocksize like 1000.
          -   A size in bytes, like "100 MiB" which will choose a uniform
              block-like shape
          -   The word "auto" which acts like the above, but uses a configuration
              value ``array.chunk-size`` for the chunk size
      M : int, optional
        Number of columns in the output. If None, defaults to `N`.
      k : int, optional
        Index of the diagonal: 0 (the default) refers to the main diagonal,
        a positive value refers to an upper diagonal, and a negative value
        to a lower diagonal.
      dtype : data-type, optional
        Data-type of the returned array.
  
      Returns
      -------
      I : Array of shape (N,M)
        An array where all elements are equal to zero, except for the `k`-th
        diagonal, whose values are equal to one.
      """
      eye = {}
      if M is None:
          M = N
      if dtype is None:
          dtype = float
  
      if not isinstance(chunks, (int, str)):
          raise ValueError("chunks must be an int or string")
  
      vchunks, hchunks = normalize_chunks(
          chunks, shape=(N, M), dtype=dtype
      )
      chunks = vchunks[0]
  
      token = tokenize(N, chunks, M, k, dtype)
      name_eye = "eye-" + token
  
      for i, vchunk in enumerate(vchunks):
          for j, hchunk in enumerate(hchunks):
              if (j - i - 1) * chunks <= k <= (j - i + 1) * chunks:
                  eye[name_eye, i, j] = (
                      np.eye,
                      vchunk,
                      hchunk,
                      k - (j - i) * chunks,
                      dtype,
                  )
              else:
                  eye[name_eye, i, j] = (
                      np.zeros,
                      (vchunk, hchunk),
                      dtype,
                  )
      return Array(
          eye,
          name_eye,
          shape=(N, M),
          chunks=(chunks, chunks),
          dtype=dtype,
      )
  
imports: from __future__ import annotations
  import itertools
  from collections.abc import Sequence
  from functools import partial
  from itertools import product
  from numbers import Integral, Number
  import numpy
  from tlz import sliding_window
  from dask.array import chunk
  from dask.array.backends import array_creation_dispatch
  from dask.array.core import Array, asarray, block, blockwise, broadcast_arrays, broadcast_to, concatenate, normalize_chunks, stack
  from dask.array.numpy_compat import AxisError
  from dask.array.ufunc import greater_equal, rint
  from dask.array.utils import meta_from_array
  from dask.array.wrap import empty, full, ones, zeros
  from dask.base import tokenize
  from dask.highlevelgraph import HighLevelGraph
  from dask.utils import cached_cumsum, derived_from, is_cupy_type
label_desc: Use image node_id 11 for calling a global function with example usage: eye(N, chunks, M, k, dtype) and returns: Array