code: def test_replace_callable_raises(any_string_dtype, repl):
      # GH 15055
      values = Series(
          ["fooBAD__barBAD", np.nan], dtype=any_string_dtype
      )
  
      # test with wrong number of arguments, raising an error
      msg = (
          r"((takes)|(missing)) (?(2)from \d+ to )?\d+ "
          r"(?(3)required )positional arguments?"
      )
      with pytest.raises(TypeError, match=msg):
          with tm.maybe_produces_warning(
              PerformanceWarning, using_pyarrow(any_string_dtype)
          ):
              values.str.replace("a", repl, regex=True)
  
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 18 for calling a global function with example usage: test_replace_callable_raises(any_string_dtype, repl) without return types