code: def _linex_error(y_true, y_pred, a=1.0, b=1.0):
      """Calculate mean linex error.
  
      Output is non-negative floating point. The best value is 0.0.
  
      Parameters
      ----------
      y_true : pd.Series, pd.DataFrame or np.array of shape (fh,) or (fh, n_outputs) \
               where fh is the forecasting horizon
          Ground truth (correct) target values.
      y_pred : pd.Series, pd.DataFrame or np.array of shape (fh,) or (fh, n_outputs) \
               where fh is the forecasting horizon
          Forecasted values.
      horizon_weight : array-like of shape (fh,), default=None
          Forecast horizon weights.
      multioutput : {'raw_values', 'uniform_average'}  or array-like of shape \
              (n_outputs,), default='uniform_average'
          Defines how to aggregate metric for multivariate (multioutput) data.
          If array-like, values used as weights to average the errors.
          If 'raw_values', returns a full set of errors in case of multioutput input.
          If 'uniform_average', errors of all outputs are averaged with uniform weight.
  
      Returns
      -------
      linex_error : float
          Array of linex errors.
  
      References
      ----------
      Diebold, Francis X. (2007). "Elements of Forecasting (4th ed.)",
      Thomson, South-Western: Ohio, US.
      """
      if not (isinstance(a, (int, float)) and a != 0):
          raise ValueError(
              "`a` must be int or float not equal to zero."
          )
      if not (isinstance(b, (int, float)) and b > 0):
          raise ValueError(
              "`b` must be an int or float greater than zero."
          )
      error = y_true - y_pred
      a_error = a * error
      linex_error = b * (np.exp(a_error) - a_error - 1)
      return linex_error
  
imports: import numpy
  from scipy.stats import gmean
  from sklearn.metrics import mean_absolute_error
  from sklearn.metrics import mean_squared_error
  from sklearn.metrics import median_absolute_error
  from sklearn.metrics._regression import _check_reg_targets
  from sklearn.utils.stats import _weighted_percentile
  from sklearn.utils.validation import check_consistent_length
  from sktime.utils.stats import _weighted_geometric_mean
label_desc: Use image node_id 24 for calling a global function with example usage: _linex_error(y_true, y_pred, a, b) and returns: linex_error