code: def array_equal(a1, a2, equal_nan=False):
      """Returns ``True`` if two arrays are element-wise exactly equal.
  
      Args:
          a1 (cupy.ndarray): Input array to compare.
          a2 (cupy.ndarray): Input array to compare.
          equal_nan (bool): If ``True``, NaN's in ``a1`` will be considered equal
              to NaN's in ``a2``.
  
      Returns:
          cupy.ndarray: A boolean 0-dim array.
          If its value is ``True``, two arrays are element-wise equal.
  
      .. seealso:: :func:`numpy.array_equal`
  
      """
      if a1.shape != a2.shape:
          return cupy.array(False)
      if not equal_nan:
          return (a1 == a2).all()
      # Handling NaN values if equal_nan is True
      a1nan, a2nan = content.isnan(a1), content.isnan(a2)
      # NaN's occur at different locations
      if not (a1nan == a2nan).all():
          return cupy.array(False)
      # Shapes of a1, a2 and masks are guaranteed to be consistent by this point
      return (a1[~a1nan] == a2[~a1nan]).all()
  
imports: import numpy
  import cupy
  from cupy import _core
  from cupy._logic import content
label_desc: Use image node_id 1 for calling a global function with example usage: array_equal(a1, a2, equal_nan) and returns: unknown, cupy, unknown, cupy