code: def array_equal(a1, a2, equal_nan: bool) -> bool:
      a1, a2 = promote_jax_arrays(a1, a2)
      if ivy.shape(a1) != ivy.shape(a2):
          return False
      eq = ivy.asarray(a1 == a2)
      if equal_nan:
          eq = ivy.logical_or(
              eq, ivy.logical_and(ivy.isnan(a1), ivy.isnan(a2))
          )
      return ivy.all(eq)
  
imports: import ivy
  from ivy.functional.frontends.jax.func_wrapper import to_ivy_arrays_and_back
  from ivy.functional.frontends.jax.numpy import promote_types_of_jax_inputs
  from ivy.utils.exceptions import IvyNotImplementedException
  from ivy.func_wrapper import with_unsupported_dtypes
label_desc: Use image node_id 5 for calling a global function with example usage: array_equal(a1, a2, equal_nan) and returns: ivy, False