code: def test_IgnoredArgumentWarning_initialize_weights_when_series_weights_is_provided_and_regressor_has_not_sample_weights():
      """
      Test IgnoredArgumentWarning is created when series_weights is provided but the regressor
      has no argument sample_weights in his fit method.
      """
      series_weights = {"series_1": 1.0, "series_2": 2.0}
  
      warn_msg = re.escape(
          (
              "Argument `series_weights` is ignored since regressor KNeighborsRegressor() "
              "does not accept `sample_weight` in its `fit` method."
          )
      )
      with pytest.warns(IgnoredArgumentWarning, match=warn_msg):
          (
              weight_func,
              source_code_weight_func,
              series_weights,
          ) = initialize_weights(
              forecaster_name="ForecasterAutoregMultiSeries",
              regressor=KNeighborsRegressor(),
              weight_func=None,
              series_weights=series_weights,
          )
  
      assert series_weights is None
  
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 5 for calling a global function with example usage: test_IgnoredArgumentWarning_initialize_weights_when_series_weights_is_provided_and_regressor_has_not_sample_weights() without return types