code: def test_date_not_found(dates):
      """Raise KeyError if passed value is not found in the index."""
      with pytest.raises(KeyError, match="No match was returned.+"):
          dates.select_rows("2011-01-02")
  
imports: import datetime
  import re
  import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
label_desc: Use image node_id 8 for calling a global function with example usage: test_date_not_found(dates) without return types