code: def test_softmax_expr():
      expr = ast.SoftmaxExpr([ast.NumVal(2.0), ast.NumVal(3.0)])
  
      expected_code = """
  import 'dart:math';
  List<double> score(List<double> input) {
      return softmax([2.0, 3.0]);
  }
  List<double> softmax(List<double> x) {
      int size = x.length;
      List<double> result = new List<double>.filled(size, 0.0);
      double maxElem = x.reduce(max);
      double sum = 0.0;
      for (int i = 0; i < size; ++i) {
          result[i] = exp(x[i] - maxElem);
          sum += result[i];
      }
      for (int i = 0; i < size; ++i)
          result[i] /= sum;
      return result;
  }
  """
  
      interpreter = DartInterpreter()
      assert_code_equal(interpreter.interpret(expr), expected_code)
  
imports: from itertools import product
  import pytest
  from m2cgen import ast
  from m2cgen.interpreters import DartInterpreter
  from tests.utils import assert_code_equal
label_desc: Use image node_id 23 for calling a global function with example usage: test_softmax_expr() without return types