code: def test_TypeError_initialize_weights_when_series_weights_is_not_a_dict(
      forecaster_name,
  ):
      """
      Test TypeError is raised when series_weights is not a dict.
      """
      series_weights = "not_Callable_or_dict"
      err_msg = re.escape(
          (
              f"Argument `series_weights` must be a dict of floats or ints."
              f"Got {type(series_weights)}."
          )
      )
      with pytest.raises(TypeError, match=err_msg):
          initialize_weights(
              forecaster_name=forecaster_name,
              regressor=LinearRegression(),
              weight_func=None,
              series_weights=series_weights,
          )
  
file_path: skforecast/skforecast/utils/tests/test_initialize_weights.py
imports: import re
  import pytest
  import numpy
  import pandas
  import inspect
  from skforecast.exceptions import IgnoredArgumentWarning
  from skforecast.utils.utils import initialize_weights
  from sklearn.linear_model import LinearRegression
  from sklearn.ensemble import RandomForestRegressor
  from sklearn.neighbors import KNeighborsRegressor
label_desc: Use image node_id 3 for calling a global function with example usage: test_TypeError_initialize_weights_when_series_weights_is_not_a_dict(forecaster_name) without return types