code: def test_dummy():
      """Tests a dummy dataset where the design matrix has perfectly correlated columns."""
      df = pd.DataFrame(
          {"a": [1, 2, 1], "b": [1, 3, 1], "c": ["a", "b", "a"]}
      )
      df = pd.get_dummies(df)
      df["y"] = [1, 6, 1]
      model_formula_str = "y~a+b+c_a+c_b"
      trained_model = fit_ml_model_with_evaluation(
          df=df,
          model_formula_str=model_formula_str,
          training_fraction=1.0,
          remove_intercept=False,
          normalize_method=None,
      )
      expected_coefs = np.array([0, 1.0, 1.0, -1.0, 1.0])
      obtained_coefs = np.array(trained_model["ml_model"].coef_).round(
          2
      )
      # The fitted coefficients are not the same as expected,
      # but the fitted values are equal to the actual y since design matrix is singular.
      assert not np.array_equal(expected_coefs, obtained_coefs)
      X = np.array(
          pd.concat(
              [
                  pd.DataFrame({"intercept": [1, 1, 1]}),
                  df[["a", "b", "c_a", "c_b"]],
              ],
              axis=1,
          )
      )
      y_fitted = X @ expected_coefs
      assert np.array_equal(np.array(df["y"]), y_fitted.round(8))
  
      n = df.shape[0]
      p_effective = trained_model["p_effective"]
      assert round(p_effective, 2) == 2
      assert trained_model["sigma_scaler"] == np.sqrt(
          (n - 1) / (n - p_effective)
      )
      assert (
          trained_model["x_mean"] is None
      )  # When the model is linear, `"x_mean"` is `None`.
      assert (
          trained_model["h_mat"].shape
          == trained_model["x_mat"].shape[::-1]
      )
  
imports: import warnings
  import numpy
  import pandas
  import pytest
  import scipy
  from pandas.testing import assert_frame_equal
  from patsy import dmatrices
  from greykite.algo.common.ml_models import breakdown_regression_based_prediction
  from greykite.algo.common.ml_models import design_mat_from_formula
  from greykite.algo.common.ml_models import fit_ml_model
  from greykite.algo.common.ml_models import fit_ml_model_with_evaluation
  from greykite.algo.common.ml_models import fit_model_via_design_matrix
  from greykite.algo.common.ml_models import get_h_mat
  from greykite.algo.common.ml_models import get_intercept_col_from_design_mat
  from greykite.algo.common.ml_models import predict_ml
  from greykite.algo.common.ml_models import predict_ml_with_uncertainty
  from greykite.algo.uncertainty.conditional.conf_interval import predict_ci
  from greykite.common.constants import ERR_STD_COL
  from greykite.common.constants import QUANTILE_SUMMARY_COL
  from greykite.common.constants import TimeFeaturesEnum
  from greykite.common.evaluation import EvaluationMetricEnum
  from greykite.common.evaluation import calc_pred_err
  from greykite.common.features.timeseries_features import build_time_features_df
  from greykite.common.features.timeseries_features import fourier_series_multi_fcn
  from greykite.common.features.timeseries_features import get_fourier_col_name
  from greykite.common.python_utils import assert_equal
  from greykite.common.testing_utils import gen_sliced_df
label_desc: Use image node_id 30 for calling a global function with example usage: test_dummy() without return types