code: def mean_asymmetric_error(
      y_true,
      y_pred,
      asymmetric_threshold=0.0,
      left_error_function="squared",
      right_error_function="absolute",
      left_error_penalty=1.0,
      right_error_penalty=1.0,
      horizon_weight=None,
      multioutput="uniform_average",
      **kwargs,
  ):
      """Calculate mean of asymmetric loss function.
  
      Output is non-negative floating point. The best value is 0.0.
  
      Error values that are less than the asymmetric threshold have
      `left_error_function` applied. Error values greater than or equal to
      asymmetric threshold  have `right_error_function` applied.
  
      Many forecasting loss functions (like those discussed in [1]_) assume that
      over- and under- predictions should receive an equal penalty. However, this
      may not align with the actual cost faced by users' of the forecasts.
      Asymmetric loss functions are useful when the cost of under- and over-
      prediction are not the same.
  
      Setting `asymmetric_threshold` to zero, `left_error_function` to 'squared'
      and `right_error_function` to 'absolute` results in a greater penalty
      applied to over-predictions (y_true - y_pred < 0). The opposite is true
      for `left_error_function` set to 'absolute' and `right_error_function`
      set to 'squared`.
  
      The left_error_penalty and right_error_penalty can be used to add differing
      multiplicative penalties to over-predictions and under-predictions.
  
      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.
      asymmetric_threshold : float, default = 0.0
          The value used to threshold the asymmetric loss function. Error values
          that are less than the asymmetric threshold have `left_error_function`
          applied. Error values greater than or equal to asymmetric threshold
          have `right_error_function` applied.
      left_error_function : {'squared', 'absolute'}, default='squared'
          Loss penalty to apply to error values less than the asymmetric threshold.
      right_error_function : {'squared', 'absolute'}, default='absolute'
          Loss penalty to apply to error values greater than or equal to the
          asymmetric threshold.
      left_error_penalty : int or float, default=1.0
          An additional multiplicative penalty to apply to error values less than
          the asymmetric threshold.
      right_error_penalty : int or float, default=1.0
          An additional multiplicative penalty to apply to error values greater
          than the asymmetric threshold.
      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
      -------
      asymmetric_loss : float
          Loss using asymmetric penalty of on errors.
          If multioutput is 'raw_values', then asymmetric loss is returned for
          each output separately.
          If multioutput is 'uniform_average' or an ndarray of weights, then the
          weighted average asymmetric loss of all output errors is returned.
  
      See Also
      --------
      mean_linex_error
  
      Notes
      -----
      Setting `left_error_function` and `right_error_function` to "absolute", but
      choosing different values for `left_error_penalty` and `right_error_penalty`
      results in the "lin-lin" error function discussed in [2]_.
  
      References
      ----------
      .. [1] Hyndman, R. J and Koehler, A. B. (2006). "Another look at measures of
         forecast accuracy", International Journal of Forecasting, Volume 22, Issue 4.
  
      .. [2] Diebold, Francis X. (2007). "Elements of Forecasting (4th ed.)",
         Thomson, South-Western: Ohio, US.
  
      Examples
      --------
      >>> import numpy as np
      >>> from sktime.performance_metrics.forecasting import mean_asymmetric_error
      >>> y_true = np.array([3, -0.5, 2, 7, 2])
      >>> y_pred = np.array([2.5, 0.0, 2, 8, 1.25])
      >>> mean_asymmetric_error(y_true, y_pred)
      0.5
      >>> mean_asymmetric_error(y_true, y_pred, left_error_function='absolute', \
      right_error_function='squared')
      0.4625
      >>> y_true = np.array([[0.5, 1], [-1, 1], [7, -6]])
      >>> y_pred = np.array([[0, 2], [-1, 2], [8, -5]])
      >>> mean_asymmetric_error(y_true, y_pred)
      0.75
      >>> mean_asymmetric_error(y_true, y_pred, left_error_function='absolute', \
      right_error_function='squared')
      0.7083333333333334
      >>> mean_asymmetric_error(y_true, y_pred, multioutput='raw_values')
      array([0.5, 1. ])
      >>> mean_asymmetric_error(y_true, y_pred, multioutput=[0.3, 0.7])
      0.85
      """
      _, y_true, y_pred, multioutput = _check_reg_targets(
          y_true, y_pred, multioutput
      )
  
      if horizon_weight is not None:
          check_consistent_length(y_true, horizon_weight)
  
      asymmetric_errors = _asymmetric_error(
          y_true,
          y_pred,
          asymmetric_threshold=asymmetric_threshold,
          left_error_function=left_error_function,
          right_error_function=right_error_function,
          left_error_penalty=left_error_penalty,
          right_error_penalty=right_error_penalty,
      )
      output_errors = np.average(
          asymmetric_errors, weights=horizon_weight, axis=0
      )
      if isinstance(multioutput, str):
          if multioutput == "raw_values":
              return output_errors
          elif multioutput == "uniform_average":
              # pass None as weights to np.average: uniform mean
              multioutput = None
  
      return np.average(output_errors, weights=multioutput)
  
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 3 for calling a global function with example usage: mean_asymmetric_error(y_true, y_pred, asymmetric_threshold, left_error_function, right_error_function, left_error_penalty, right_error_penalty, horizon_weight, multioutput) and returns: np, output_errors