code: def test_assert_produces_warning_honors_filter():
      # Raise by default.
      msg = r"Caused unexpected warning\(s\)"
      with pytest.raises(AssertionError, match=msg):
          with tm.assert_produces_warning(RuntimeWarning):
              f()
  
      with tm.assert_produces_warning(
          RuntimeWarning, raise_on_extra_warnings=False
      ):
          f()
  
imports: import warnings
  import pytest
  from pandas.errors import DtypeWarning, PerformanceWarning
  import pandas._testing
label_desc: Use image node_id 3 for calling a global function with example usage: test_assert_produces_warning_honors_filter() without return types