code: def test_sample_weight():
      # Ensure sample weights are passed to underlying estimator
      X, y = datasets.make_classification(
          n_samples=100,
          n_features=10,
          n_informative=3,
          n_redundant=0,
          n_repeated=0,
          shuffle=False,
          random_state=0,
      )
  
      # Check with sample weights
      sample_weight = np.ones(y.shape)
      sample_weight[y == 1] *= 100
  
      est = LogisticRegression(random_state=0, fit_intercept=False)
      transformer = SelectFromModel(estimator=est)
      transformer.fit(X, y, sample_weight=None)
      mask = transformer._get_support_mask()
      transformer.fit(X, y, sample_weight=sample_weight)
      weighted_mask = transformer._get_support_mask()
      assert not np.all(weighted_mask == mask)
      transformer.fit(X, y, sample_weight=3 * sample_weight)
      reweighted_mask = transformer._get_support_mask()
      assert np.all(weighted_mask == reweighted_mask)
  
imports: import re
  import warnings
  from unittest.mock import Mock
  import numpy
  import pytest
  from sklearn import datasets
  from sklearn.base import BaseEstimator
  from sklearn.cross_decomposition import CCA, PLSCanonical, PLSRegression
  from sklearn.datasets import make_friedman1
  from sklearn.decomposition import PCA
  from sklearn.ensemble import HistGradientBoostingClassifier, RandomForestClassifier
  from sklearn.exceptions import NotFittedError
  from sklearn.feature_selection import SelectFromModel
  from sklearn.linear_model import ElasticNet, ElasticNetCV, Lasso, LassoCV, LogisticRegression, PassiveAggressiveClassifier, SGDClassifier
  from sklearn.pipeline import make_pipeline
  from sklearn.svm import LinearSVC
  from sklearn.utils._testing import MinimalClassifier, assert_allclose, assert_array_almost_equal, assert_array_equal, skip_if_32bit
label_desc: Use image node_id 12 for calling a global function with example usage: test_sample_weight() without return types