code: def quant_pred(q, data, **params):
      """
      Quantile precitions
      """
      import statsmodels.formula.api as smf
  
      mod = smf.quantreg(params["formula"], data)
      reg_res = mod.fit(q=q, **params["method_args"])
      out = pd.DataFrame(
          {
              "x": [data["x"].min(), data["x"].max()],
              "quantile": q,
              "group": f"{data['group'].iloc[0]}-{q}",
          }
      )
      out["y"] = reg_res.predict(out)
      return out
  
file_path: plotnine/plotnine/stats/stat_quantile.py
imports: from warnings import warn
  import pandas
  from ..doctools import document
  from ..exceptions import PlotnineWarning
  from .stat import stat
label_desc: Use image node_id 1 for calling a global function with example usage: quant_pred(q, data) and returns: out