code: def test_rmse_with_sklearn(sample_weight):
      """
      Ensure
      (1) Without sample_weight, AutoGluon's custom rmse produces the same result as sklearn's rmse
      (2) With sample_weight, computed wrmse is as expected
      """
      y_true = np.array([0, 0, 1, 1, 1, 1, 0])
      y_pred = np.array([0.13, 0.09, 0.78, 0.43, 0.8, 0.91, 0.32])
      expected_rmse = sklearn.metrics.mean_squared_error(
          y_true, y_pred, squared=False, sample_weight=sample_weight
      )
  
      kwargs = {"y_true": y_true, "y_pred": y_pred}
      if sample_weight is not None:
          kwargs["sample_weight"] = sample_weight
      computed_rmse = rmse_func(**kwargs)
  
      assert np.isclose(computed_rmse, expected_rmse)
  
file_path: autogluon/core/tests/unittests/metrics/test_metrics.py
imports: from math import isclose
  import numpy
  import pytest
  import sklearn
  from autogluon.core.constants import BINARY, MULTICLASS, QUANTILE, REGRESSION
  from autogluon.core.metrics import METRICS, Scorer, rmse_func
label_desc: Use image node_id 10 for calling a global function with example usage: test_rmse_with_sklearn(sample_weight) without return types