code: def test_cosine_invcdf_invalid_p():
      # Check that p values outside of [0, 1] return nan.
      assert np.isnan(_cosine_invcdf([-0.1, 1.1])).all()
  
file_path: scipy/scipy/special/tests/test_cosine_distr.py
imports: import numpy
  from numpy.testing import assert_allclose
  import pytest
  from scipy.special._ufuncs import _cosine_cdf, _cosine_invcdf
label_desc: Use image node_id 4 for calling a global function with example usage: test_cosine_invcdf_invalid_p() without return types