code: def test_initialize_weights_finds_sample_weight_in_different_regressors_when_series_weights(
      recwarn, regressor
  ):
      """
      Test initialize weights finds `sample_weight` attribute in different
      regressors when `series_weights`.
      """
      series_weights = {"series_1": 1.0, "series_2": 2.0}
  
      (
          weight_func,
          source_code_weight_func,
          series_weights,
      ) = initialize_weights(
          forecaster_name="ForecasterAutoregMultiSeries",
          regressor=regressor,
          weight_func=None,
          series_weights=series_weights,
      )
  
      # Count the number of warnings, it should be 0
      assert len(recwarn) == 0
  
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 7 for calling a global function with example usage: test_initialize_weights_finds_sample_weight_in_different_regressors_when_series_weights(recwarn, regressor) without return types