code: def mae(predictions, verbose=True):
      """Compute MAE (Mean Absolute Error).
  
      .. math::
          \\text{MAE} = \\frac{1}{|\\hat{R}|} \\sum_{\\hat{r}_{ui} \\in
          \\hat{R}}|r_{ui} - \\hat{r}_{ui}|
  
      Args:
          predictions (:obj:`list` of :obj:`Prediction\
              <surprise.prediction_algorithms.predictions.Prediction>`):
              A list of predictions, as returned by the :meth:`test()
              <surprise.prediction_algorithms.algo_base.AlgoBase.test>` method.
          verbose: If True, will print computed value. Default is ``True``.
  
  
      Returns:
          The Mean Absolute Error of predictions.
  
      Raises:
          ValueError: When ``predictions`` is empty.
      """
  
      if not predictions:
          raise ValueError("Prediction list is empty.")
  
      mae_ = np.mean(
          [
              float(abs(true_r - est))
              for (_, _, true_r, est, _) in predictions
          ]
      )
  
      if verbose:
          print(f"MAE:  {mae_:1.4f}")
  
      return mae_
  
imports: from collections import defaultdict
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: mae(predictions, verbose) and returns: mae_