code: def _rhat_rank(ary):
      """Compute the rank normalized rhat for 2d array.
  
      Computation follows https://arxiv.org/abs/1903.08008
      """
      ary = np.asarray(ary)
      if _not_valid(ary, shape_kwargs=dict(min_draws=4, min_chains=2)):
          return np.nan
      split_ary = _split_chains(ary)
      rhat_bulk = _rhat(_z_scale(split_ary))
  
      split_ary_folded = abs(split_ary - np.median(split_ary))
      rhat_tail = _rhat(_z_scale(split_ary_folded))
  
      rhat_rank = max(rhat_bulk, rhat_tail)
      return rhat_rank
  
imports: import warnings
  from collections.abc import Sequence
  import numpy
  import packaging
  import pandas
  import scipy
  from scipy import stats
  from ..data import convert_to_dataset
  from ..utils import Numba, _numba_var, _stack, _var_names
  from .density_utils import histogram
  from .stats_utils import _circular_standard_deviation, _sqrt
  from .stats_utils import autocov
  from .stats_utils import not_valid
  from .stats_utils import quantile
  from .stats_utils import stats_variance_2d
  from .stats_utils import wrap_xarray_ufunc
label_desc: Use image node_id 12 for calling a global function with example usage: _rhat_rank(ary) and returns: rhat_rank, np