code: def test_nan_behaviour(self, func):
      data = np.random.randn(100, 4)
      data[
          0, 0
      ] = np.nan  #  pylint: disable=unsupported-assignment-operation
      if func == "_mcse_quantile":
          assert np.isnan(_mcse_quantile(data, 0.5)).all(None)
      elif packaging.version.parse(
          scipy.__version__
      ) < packaging.version.parse("1.10.0.dev0"):
          assert not np.isnan(_z_scale(data)).all(None)
          assert not np.isnan(_z_scale(data)).any(None)
      else:
          assert np.isnan(_z_scale(data)).sum() == 1
  
imports: import os
  import numpy
  import packaging
  import pandas
  import pytest
  import scipy
  from numpy.testing import assert_almost_equal
  from ...data import from_cmdstan, load_arviz_data
  from ...rcparams import rcParams
  from ...sel_utils import xarray_var_iter
  from ...stats import bfmi, ess, mcse, rhat
  from ...stats.diagnostics import _ess, _ess_quantile, _mc_error, _mcse_quantile, _multichain_statistics, _rhat, _rhat_rank, _split_chains, _z_scale, ks_summary
label_desc: Use image node_id 29 for calling the TestDiagnostics obj's underlying member method code with example usage: obj.test_nan_behaviour(func) without return types