code: def test_estimator_regression(estimator, check):
      """Test compatibility with the scikit-learn API for regressors."""
      if "predict" in check.func.__name__:
          # Predict methods do a simple passthrough to the underlying best estimator
          # https://github.com/scikit-learn/scikit-learn/blob/1.0.2/sklearn/model_selection/_search.py#L493
          pytest.skip(
              "Skipping tests that leverage passthrough to underlying estimator."
          )
      elif "nan" in check.func.__name__:
          pytest.skip(
              "Skipping tests that check for compatiblity with nulls. Underlying estimator should check."
          )
      else:
          check(estimator)
  
imports: import pytest
  from sklearn.linear_model import Ridge, RidgeClassifier
  from sklearn.utils.estimator_checks import check_estimator
  from hyperopt import hp
  from hyperopt.sklearn import HyperoptSearchCV
label_desc: Use image node_id 1 for calling a global function with example usage: test_estimator_regression(estimator, check) without return types