code: def _plot_quantile_forecast(
      sub: plt.Axes,
      query_past: np.ndarray,
      query_future: np.ndarray,
      pred: np.ndarray,
      quantiles: List[str],
  ):
      """
      Plots the provided forecast with confidence intervals using all provided quantiles.
  
      Parameters
      ----------
      sub: plt.Axis
          The axis object to plot on.
      query_past: np.ndarray, shape[context length]
          The past query which the model uses to make a prediction.
      query_future: np.ndarray, shape[prediction horizon length]
          The ground truth for the forecast.
      pred: np.ndarray, shape[prediction horizon length, n_quantiles]
          The prediction of the model.
      quantiles: List[str], shape[n_quantiles,]
      """
      assert len(pred) == len(
          query_future
      ), f"len pred is {len(pred)}, len query_future is {len(query_future)}"
      query = np.concatenate([query_past, query_future])
      sub.plot(query, label="gt")
      sub.axvline(
          len(query_past) - 1, color="r"
      )  # end of train dataset
      pred_time = np.arange(
          len(query_past), len(query_past) + len(pred)
      )
      cmap = plt.get_cmap("Oranges")
      # Plot the shapes for the confidence intervals, starting with the outermost
      num_intervals = pred.shape[-1] // 2
      for i in range(num_intervals):
          lower = pred[..., i]
          upper = pred[..., -(i + 1)]
          ci = 100 - 2 * int(float(quantiles[i]) * 100)
          cmap_index = int((cmap.N / (num_intervals + 1)) * (i + 1))
          if len(pred) > 1:
              sub.fill_between(
                  pred_time,
                  lower,
                  upper,
                  color=cmap(cmap_index),
                  label=f"{ci}% CI",
              )
          else:
              sub.fill_between(
                  np.append(pred_time, pred_time[0] + 0.5),
                  np.repeat(lower, 2),
                  np.repeat(upper, 2),
                  color=cmap(cmap_index),
                  label=f"{ci}% CI",
              )
      if len(pred) > 1:
          sub.plot(
              pred_time,
              pred[..., num_intervals],
              color="black",
              label="pred median",
          )
      else:
          sub.plot(
              np.append(pred_time, pred_time[0] + 0.5),
              np.repeat(pred[..., num_intervals], 2),
              color="black",
              label="pred median",
          )
      sub.legend()
  
imports: from typing import List
  import numpy
  import matplotlib.pyplot
label_desc: Use image node_id 3 for calling a global function with example usage: _plot_quantile_forecast(sub, query_past, query_future, pred, quantiles) without return types