code: def _spatial_deviation(p, q, r_est, r_true):
      q = _abs_col_sum(q)
      if np.sum(q):
          q /= np.sum(q)
          r_true_tile = np.tile(r_true, (r_est.shape[0], 1))
          r_diff = r_est - r_true_tile
          r_diff_norm = np.sum(r_diff**2, axis=1)
          return np.sqrt(np.dot(q, r_diff_norm))
      else:
          return np.inf
  
imports: from functools import partial
  import numpy
  from scipy.spatial.distance import cdist
  from ...utils import _check_option, _validate_type, fill_doc
label_desc: Use image node_id 23 for calling a global function with example usage: _spatial_deviation(p, q, r_est, r_true) and returns: np, np