code: def eye(
      n_rows: int,
      n_cols: Optional[int] = None,
      /,
      *,
      k: int = 0,
      batch_shape: Optional[Union[int, Sequence[int]]] = None,
      dtype: paddle.dtype,
      device: core.Place = None,
      out: Optional[paddle.Tensor] = None,
  ) -> paddle.Tensor:
      if n_cols is None:
          n_cols = n_rows
      if batch_shape is None:
          batch_shape = []
      i = paddle.eye(n_rows, n_cols, dtype=dtype)
      reshape_dims = [1] * len(batch_shape) + [n_rows, n_cols]
      tile_dims = list(batch_shape) + [1, 1]
  
      # handle index of the diagonal k
      if k == 0:
          return paddle.reshape(i, reshape_dims)
  
      elif -n_rows < k < 0:
          mat = paddle.concat(
              [
                  paddle.zeros([-k, n_cols], dtype=dtype),
                  i[: n_rows + k],
              ],
              0,
          )
          return paddle.tile(
              paddle.reshape(mat, reshape_dims), tile_dims
          )
  
      elif 0 < k < n_cols:
          mat = paddle.concat(
              [
                  paddle.zeros([n_rows, k], dtype=dtype),
                  i[:, : n_cols - k],
              ],
              1,
          )
          return paddle.tile(
              paddle.reshape(mat, reshape_dims), tile_dims
          )
      else:
          return paddle.zeros(
              batch_shape + [n_rows, n_cols], dtype=dtype
          )
  
imports: import struct
  from numbers import Number
  from typing import Union, List, Optional, Sequence, Tuple
  import numpy
  import paddle
  import ivy.functional.backends.paddle
  import ivy
  from ivy.func_wrapper import with_unsupported_device_and_dtypes
  from ivy.functional.ivy.creation import _asarray_to_native_arrays_and_back, _asarray_infer_device, _asarray_handle_nestable, _asarray_infer_dtype, NestedSequence, SupportsBufferProtocol, _asarray_inputs_to_native_shapes, _remove_np_bfloat16
  from .None import backend_version
  from paddle.device import core
label_desc: Use image node_id 5 for calling a global function with example usage: eye() and returns: paddle, paddle, paddle, paddle