code: def _apply(
      func,
      image,
      footprint,
      out,
      mask,
      shift_x,
      shift_y,
      p0,
      p1,
      out_dtype=None,
  ):
      check_nD(image, 2)
      image, footprint, out, mask, n_bins = _preprocess_input(
          image, footprint, out, mask, out_dtype
      )
  
      func(
          image,
          footprint,
          shift_x=shift_x,
          shift_y=shift_y,
          mask=mask,
          out=out,
          n_bins=n_bins,
          p0=p0,
          p1=p1,
      )
  
      return out.reshape(out.shape[:2])
  
file_path: scikit-image/skimage/filters/rank/_percentile.py
imports: from ..._shared.utils import check_nD
  from .None import percentile_cy
  from .generic import _preprocess_input
label_desc: Use image node_id 1 for calling a global function with example usage: _apply(func, image, footprint, out, mask, shift_x, shift_y, p0, p1, out_dtype) and returns: out