code: def test_to_offset_invalid(freqstr):
      # see gh-13930
  
      # We escape string because some of our
      # inputs contain regex special characters.
      msg = re.escape(f"Invalid frequency: {freqstr}")
      with pytest.raises(ValueError, match=msg):
          to_offset(freqstr)
  
file_path: pandas/pandas/tests/tslibs/test_to_offset.py
imports: import re
  import pytest
  from pandas._libs.tslibs import Timedelta, offsets, to_offset
label_desc: Use image node_id 3 for calling a global function with example usage: test_to_offset_invalid(freqstr) without return types