code: def _compute_quantile(data, dims, cutoffs):
          
          # numpy doesn't get a 'quantile' function until 1.15
          # for better backwards compatibility we use xarray's version
          data_arr = xr.DataArray(data, dims=dims)
          # delayed will provide us the fully computed xarray with ndarray
          left, right = data_arr.quantile([cutoffs[0], 1. - cutoffs[1]], dim=['x', 'y'])
          logger.debug("Interval: left=%s, right=%s", str(left), str(right))
          return left.data, right.data
docs: Helper method for stretch_linear.
  
          Dask delayed functions need to be non-internal functions (created
          inside a function) to be serializable on a multi-process scheduler.
  
          Quantile requires the data to be loaded since it not supported on
          dask arrays yet.