code: def test_score():
      """Tests score function"""
      model = DummyEstimator(
          strategy="mean", score_func=mean_absolute_error
      )
      X = pd.DataFrame(
          {
              TIME_COL: pd.date_range(
                  "2018-01-01", periods=3, freq="1D"
              ),
              VALUE_COL: [2.0, 3.0, 4.0],
          }
      )
      model.fit(X)  # prediction is 3.0
  
      y = pd.Series([1.0, 2.0, 3.0])
  
      assert model.score(X, y) == mean_absolute_error(
          y, np.repeat(3.0, X.shape[0])
      )
  
file_path: greykite/greykite/tests/sklearn/estimator/test_null_model.py
imports: import numpy
  import pandas
  from sklearn.metrics import mean_absolute_error
  from sklearn.metrics import mean_squared_error
  from greykite.common.constants import PREDICTED_COL
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.sklearn.estimator.null_model import DummyEstimator
label_desc: Use image node_id 7 for calling a global function with example usage: test_score() without return types