code: def test_mae():
      """Tests for the MAE function."""
  
      predictions = [pred(0, 0), pred(1, 1), pred(2, 2), pred(100, 100)]
      assert mae(predictions) == 0
  
      predictions = [pred(0, 0), pred(0, 2)]
      assert mae(predictions) == abs(0 - 2) / 2
  
      predictions = [pred(2, 0), pred(3, 4)]
      assert mae(predictions) == (abs(2 - 0) + abs(3 - 4)) / 2
  
      with pytest.raises(ValueError):
          mae([])
  
imports: from math import sqrt
  import pytest
  from surprise.accuracy import fcp, mae, mse, rmse
label_desc: Use image node_id 2 for calling a global function with example usage: test_mae() without return types