code: def test_function_sampler_func_kwargs(X, y):
      def func(X, y, sampling_strategy, random_state):
          rus = RandomUnderSampler(
              sampling_strategy=sampling_strategy,
              random_state=random_state,
          )
          return rus.fit_resample(X, y)
  
      sampler = FunctionSampler(
          func=func,
          kw_args={"sampling_strategy": "auto", "random_state": 0},
      )
      X_res, y_res = sampler.fit_resample(X, y)
      X_res_2, y_res_2 = RandomUnderSampler(
          random_state=0
      ).fit_resample(X, y)
      assert_allclose_dense_sparse(X_res, X_res_2)
      assert_array_equal(y_res, y_res_2)
  
file_path: imbalanced-learn/imblearn/tests/test_base.py
imports: import numpy
  import pytest
  from scipy import sparse
  from sklearn.datasets import load_iris, make_regression
  from sklearn.linear_model import LinearRegression
  from sklearn.utils import _safe_indexing
  from sklearn.utils._testing import assert_allclose_dense_sparse, assert_array_equal
  from sklearn.utils.multiclass import type_of_target
  from imblearn import FunctionSampler
  from imblearn.datasets import make_imbalance
  from imblearn.pipeline import make_pipeline
  from imblearn.under_sampling import RandomUnderSampler
label_desc: Use image node_id 4 for calling a global function with example usage: test_function_sampler_func_kwargs(X, y) and returns: rus