code: def heaviside(
      x1: Union[ivy.Array, ivy.NativeArray],
      x2: Union[ivy.Array, ivy.NativeArray],
      /,
      *,
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """Compute the Heaviside step function for each element in x1.
  
      Parameters
      ----------
      x1
          input array.
      x2
          values to use where x1 is zero.
      out
          optional output array, for writing the result to.
  
      Returns
      -------
      ret
          output array with element-wise Heaviside step function of x1.
          This is a scalar if both x1 and x2 are scalars.
  
      Examples
      --------
      With :class:`ivy.Array` input:
  
      >>> x1 = ivy.array([-1.5, 0, 2.0])
      >>> x2 = ivy.array([0.5])
      >>> ivy.heaviside(x1, x2)
      ivy.array([0.0000, 0.5000, 1.0000])
  
      >>> x1 = ivy.array([-1.5, 0, 2.0])
      >>> x2 = ivy.array([1.2, -2.0, 3.5])
      >>> ivy.heaviside(x1, x2)
      ivy.array([0., -2., 1.])
      """
      return ivy.current_backend().heaviside(x1, x2, out=out)
  
imports: from typing import Optional, Union, Tuple, Iterable, Sequence, Callable, Any, Literal, List
  from numbers import Number
  from functools import partial
  import math
  import ivy
  from ivy.func_wrapper import handle_out_argument, handle_partial_mixed_function, to_native_arrays_and_back, inputs_to_native_shapes, handle_nestable, handle_array_like_without_promotion, handle_view, inputs_to_ivy_arrays, handle_array_function, handle_device, handle_backend_invalid
  from ivy.functional.ivy.general import _numel
  from ivy.utils.backend import current_backend
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 6 for calling a global function with example usage: heaviside() and returns: ivy