code: def haar(f, preserve_energy=True, inline=False):
      """
      t = haar(f, preserve_energy=True, inline=False)
  
      Haar transform
  
      Parameters
      ----------
      f : 2-D ndarray
          Input image
      preserve_energy : bool, optional
          Whether to normalise the result so that energy is preserved (the
          default).
      inline : bool, optional
          Whether to write the results to the input image. By default, a new
          image is returned. Integer images are always converted to floating
          point and copied.
  
      See Also
      --------
      ihaar : function
          Reverse Haar transform
      """
      f = _wavelet_array(f, inline, "haar")
      _convolve.haar(f)
      _convolve.haar(f.T)
      if preserve_energy:
          f /= 2.0
      return f
  
imports: import numpy
  from .None import _convolve
  from .None import morph
  from .internal import _get_output, _normalize_sequence, _verify_is_floatingpoint_type, _as_floating_point_array
  from ._filters import mode2int, modes, _check_mode
label_desc: Use image node_id 14 for calling a global function with example usage: haar(f, preserve_energy, inline) and returns: f