code: def test_replace_literal_compiled_raises(any_string_dtype):
      ser = Series([], dtype=any_string_dtype)
      pat = re.compile("[a-z][A-Z]{2}")
  
      msg = "Cannot use a compiled regex as replacement pattern with regex=False"
      with pytest.raises(ValueError, match=msg):
          ser.str.replace(pat, "", regex=False)
  
imports: from datetime import datetime
  import re
  import numpy
  import pytest
  from pandas.errors import PerformanceWarning
  import pandas.util._test_decorators
  import pandas
  from pandas import Series, _testing
  from pandas.tests.strings import _convert_na_value, object_pyarrow_numpy
label_desc: Use image node_id 27 for calling a global function with example usage: test_replace_literal_compiled_raises(any_string_dtype) without return types