code: def _bayes_thresh(details, var):
      """BayesShrink threshold for a zero-mean details coeff array."""
      # Equivalent to:  dvar = np.var(details) for 0-mean details array
      dvar = np.mean(details * details)
      eps = np.finfo(details.dtype).eps
      thresh = var / np.sqrt(max(dvar - var, eps))
      return thresh
  
imports: import functools
  from math import ceil
  import numbers
  import scipy.stats
  import numpy
  from ..util.dtype import img_as_float
  from .._shared import utils
  from .._shared.utils import _supported_float_type, warn
  from ._denoise_cy import _denoise_bilateral, _denoise_tv_bregman
  from ..None import color
  from ..color.colorconv import ycbcr_from_rgb
label_desc: Use image node_id 8 for calling a global function with example usage: _bayes_thresh(details, var) and returns: thresh