code: def test_init_TypeError_when_weight_func_argument_is_not_Callable():
      """
      Test TypeError is raised when weight_func is not a callable.
      """
      weight_func = "---"
      err_msg = re.escape(
          f"Argument `weight_func` must be a Callable. Got {type(weight_func)}."
      )
      with pytest.raises(TypeError, match=err_msg):
          ForecasterAutoregCustom(
              regressor=LinearRegression(),
              fun_predictors=create_predictors,
              window_size=5,
              weight_func=weight_func,
          )
  
file_path: skforecast/skforecast/ForecasterAutoregCustom/tests/test_init.py
imports: import re
  import pytest
  import pandas
  import numpy
  from skforecast.ForecasterAutoregCustom import ForecasterAutoregCustom
  from skforecast.exceptions import IgnoredArgumentWarning
  from sklearn.linear_model import LinearRegression
  from sklearn.neighbors import KNeighborsRegressor
label_desc: Use image node_id 6 for calling a global function with example usage: test_init_TypeError_when_weight_func_argument_is_not_Callable() without return types