code: def quantile_loss(
      target: np.ndarray, forecast: np.ndarray, q: float
  ) -> float:
      r"""
      .. math::
  
          quantile\_loss = 2 * sum(|(Y - \hat{Y}) * (Y <= \hat{Y}) - q|)
      """
      return 2 * np.sum(
          np.abs((forecast - target) * ((target <= forecast) - q))
      )
  
file_path: gluonts/src/gluonts/evaluation/metrics.py
imports: from typing import Optional
  import numpy
  from gluonts.time_feature import get_seasonality
label_desc: Use image node_id 4 for calling a global function with example usage: quantile_loss(target, forecast, q) and returns: unknown