code: def symmetric_mean_absolute_percentage_error(
      y_true,
      y_pred,
      *,
      sample_weight=None,
      multioutput="uniform_average",
  ):
      """Symmetric Mean absolute percentage error (sMAPE) metric using sklearn's api and helpers.
  
      Parameters
      ----------
      y_true : array-like of shape (n_samples,) or (n_samples, n_outputs)
          Ground truth (correct) target values.
      y_pred : array-like of shape (n_samples,) or (n_samples, n_outputs)
          Estimated target values.
      sample_weight : array-like of shape (n_samples,), default=None
          Sample weights.
      multioutput : {'raw_values', 'uniform_average'} or array-like
          Defines aggregating of multiple output values.
          Array-like value defines weights used to average errors.
          If input is list then the shape must be (n_outputs,).
          'raw_values' :
              Returns a full set of errors in case of multioutput input.
          'uniform_average' :
              Errors of all outputs are averaged with uniform weight.
      Returns
      -------
      loss : float or ndarray of floats
          If multioutput is 'raw_values', then mean absolute percentage error
          is returned for each output separately.
          If multioutput is 'uniform_average' or an ndarray of weights, then the
          weighted average of all output errors is returned.
          sMAPE output is non-negative floating point. The best value is 0.0.
      """
      y_type, y_true, y_pred, multioutput = _check_reg_targets(
          y_true, y_pred, multioutput
      )
      check_consistent_length(y_true, y_pred, sample_weight)
      epsilon = np.finfo(np.float64).eps
      smape = (
          2
          * np.abs(y_pred - y_true)
          / (
              np.maximum(np.abs(y_true), epsilon)
              + np.maximum(np.abs(y_pred), epsilon)
          )
      )
      output_errors = np.average(smape, weights=sample_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)
  
file_path: evaluate/metrics/smape/smape.py
imports: import datasets
  import numpy
  from sklearn.metrics._regression import _check_reg_targets
  from sklearn.utils.validation import check_consistent_length
  import evaluate
label_desc: Use image node_id 1 for calling a global function with example usage: symmetric_mean_absolute_percentage_error(y_true, y_pred) and returns: np, output_errors