code: def test_initialize_weights_finds_sample_weight_in_different_regressors_when_weight_func(
      recwarn, regressor
  ):
      """
      Test initialize weights finds `sample_weight` attribute in different
      regressors when `weight_func`.
      """
  
      def weight_func():  # pragma: no cover
          pass
  
      weight_func, source_code_weight_func, _ = initialize_weights(
          forecaster_name="ForecasterAutoreg",
          regressor=regressor,
          weight_func=weight_func,
          series_weights=None,
      )
  
      # 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 6 for calling a global function with example usage: test_initialize_weights_finds_sample_weight_in_different_regressors_when_weight_func(recwarn, regressor) without return types