code: def eye(
      n_rows: int,
      n_cols: Optional[int] = None,
      /,
      *,
      k: int = 0,
      batch_shape: Optional[Union[int, Sequence[int]]] = None,
      dtype: np.dtype,
      device: Optional[str] = None,
      out: Optional[np.ndarray] = None,
  ) -> np.ndarray:
      if n_cols is None:
          n_cols = n_rows
      i = np.eye(n_rows, n_cols, k, dtype)
      if batch_shape is None:
          return i
      else:
          reshape_dims = [1] * len(batch_shape) + [n_rows, n_cols]
          tile_dims = list(batch_shape) + [1, 1]
          return_mat = np.tile(np.reshape(i, reshape_dims), tile_dims)
          return return_mat
  
imports: from numbers import Number
  from typing import Union, Optional, List, Sequence, Tuple
  import numpy
  import ivy
  from ivy.functional.ivy.creation import _asarray_to_native_arrays_and_back, _asarray_infer_device, _asarray_infer_dtype, _asarray_handle_nestable, NestedSequence, SupportsBufferProtocol, _asarray_inputs_to_native_shapes
  from .data_type import as_native_dtype
label_desc: Use image node_id 5 for calling a global function with example usage: eye() and returns: i, return_mat