code: def check_equal(x1, x2, inverse=False, message="", as_array=True):
      # not_equal
      def eq_fn(x1, x2):
          return x1 == x2 if inverse else x1 != x2
  
      def comp_fn(x1, x2):
          return ivy.any(eq_fn(x1, x2))
  
      if not as_array:
  
          def iter_comp_fn(x1_, x2_):
              return any(eq_fn(x1, x2) for x1, x2 in zip(x1_, x2_))
  
          def comp_fn(x1, x2):  # noqa F811
              return iter_comp_fn(*_broadcast_inputs(x1, x2))
  
      eq = comp_fn(x1, x2)
      if inverse and eq:
          raise ivy.utils.exceptions.IvyException(
              f"{x1} must not be equal to {x2}"
              if message == ""
              else message
          )
      elif not inverse and eq:
          raise ivy.utils.exceptions.IvyException(
              f"{x1} must be equal to {x2}"
              if message == ""
              else message
          )
  
imports: import ivy
label_desc: Use image node_id 4 for calling a global function with example usage: check_equal(x1, x2, inverse, message, as_array) and returns: unknown, ivy, any, iter_comp_fn