code: def test_quantile_regression_fit_predict_mape(data):
      """Tests fitting quantile regression fit and predict optimizing mape."""
      qr = QuantileRegression(quantile=0.8, alpha=0, optimize_mape=True)
      with LogCapture(LOGGER_NAME) as log_capture:
          qr.fit(data["x"], data["y"])
          qr.predict(data["x"])
          assert qr.quantile == 0.5
          assert all(qr.sample_weight == 1 / np.abs(data["y"]))
          log_capture.check_present(
              (
                  LOGGER_NAME,
                  "WARNING",
                  "The parameter 'optimize_mape' is set to 'True', "
                  "ignoring the input 'quantile' and 'sample_weight', "
                  "setting 'quantile' to 0.5 and 'sample_weight' to the inverse "
                  "absolute values of the response.",
              )
          )
  
file_path: greykite/greykite/tests/algo/common/test_l1_quantile_regression.py
imports: import numpy
  import pytest
  from testfixtures import LogCapture
  from greykite.algo.common.l1_quantile_regression import QuantileRegression
  from greykite.algo.common.l1_quantile_regression import l1_quantile_regression
  from greykite.algo.common.l1_quantile_regression import ordinary_quantile_regression
  from greykite.common.logging import LOGGER_NAME
label_desc: Use image node_id 7 for calling a global function with example usage: test_quantile_regression_fit_predict_mape(data) without return types