code: def test_nan(how):
      assert not not_valid(
          np.ones(10), check_shape=False, nan_kwargs=dict(how=how)
      )
      if how == "any":
          assert not_valid(
              np.concatenate(
                  (np.random.randn(100), np.full(2, np.nan))
              ),
              check_shape=False,
              nan_kwargs=dict(how=how),
          )
      else:
          assert not not_valid(
              np.concatenate(
                  (np.random.randn(100), np.full(2, np.nan))
              ),
              check_shape=False,
              nan_kwargs=dict(how=how),
          )
          assert not_valid(
              np.full(10, np.nan),
              check_shape=False,
              nan_kwargs=dict(how=how),
          )
  
imports: import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal
  from scipy.special import logsumexp
  from scipy.stats import circstd
  from ...data import from_dict, load_arviz_data
  from ...stats.density_utils import histogram
  from ...stats.stats_utils import ELPDData, _angle, _circfunc, _circular_standard_deviation, _sqrt, get_log_likelihood
  from ...stats.stats_utils import logsumexp
  from ...stats.stats_utils import make_ufunc, not_valid, stats_variance_2d, wrap_xarray_ufunc
label_desc: Use image node_id 12 for calling a global function with example usage: test_nan(how) without return types