code: def test_rank_naoption_raises(
      rank_method, ascending, na_option, pct, vals
  ):
      df = DataFrame({"key": ["foo"] * 5, "val": vals})
      msg = "na_option must be one of 'keep', 'top', or 'bottom'"
  
      with pytest.raises(ValueError, match=msg):
          df.groupby("key").rank(
              method=rank_method,
              ascending=ascending,
              na_option=na_option,
              pct=pct,
          )
  
imports: from datetime import datetime
  import numpy
  import pytest
  import pandas
  from pandas import DataFrame, NaT, Series, concat
  import pandas._testing
label_desc: Use image node_id 9 for calling a global function with example usage: test_rank_naoption_raises(rank_method, ascending, na_option, pct, vals) without return types