code: def template_match(
      f, template, mode="reflect", cval=0.0, out=None, output=None
  ):
      """Match template to image
  
      match = template_match(f, template, mode='reflect', cval=0., out={np.empty_like(f)})
  
      The value at ``match[i,j]`` will be the difference (in squared euclidean
      terms), between `template` and a same sized window on `f` centered on that
      point.
  
      Note that the computation is performed using the same dtype as ``f``. Thus
      is may overflow if the template is large.
  
      Parameters
      ----------
      f : ndarray
          input. Any dimension is supported
      template : ndarray
          Template to match. Must be explicitly passed, no default.
      mode : {'reflect' [default], 'nearest', 'wrap', 'mirror', 'constant', 'ignore'}
          How to handle borders
      cval : double, optional
          If `mode` is constant, which constant to use (default: 0.0)
      out : ndarray, optional
          Output array. Must have same shape and dtype as `f` as well as be
          C-contiguous.
  
      Returns
      -------
      match : ndarray of same type and shape as ``f``
          match[i,j] is the squared euclidean distance between
          ``f[i-s0:i+s0,j-s1:j+s1]`` and ``template`` (for appropriately defined
          ``s0`` and ``s1``).
      """
      template = template.astype(f.dtype, copy=False)
      output = _get_output(f, out, "template_match", output=output)
      _check_mode(mode, cval, "template_match")
      return _convolve.template_match(
          f, template, output, mode2int[mode], 0
      )
  
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 6 for calling a global function with example usage: template_match(f, template, mode, cval, out, output) and returns: _convolve