What does the formula $1-\sum_i(e_i-a_i)^2$ mean in this NEAT Python API?
$$1-\sum_i(e_i-a_i)^2$$
$\sum$ - there just means sum. It is the greek letter for S.  You can rewrite the above formula as
$$1 -[(e_1 - a_1)^2+(e_2-a_2)^2+(e_3-a_3)^2+\ldots ]$$
$\sum$ just helps us avoid writing dozens of $+$ signs. Read more here.
What they are doing here is taking the difference of expected value $e_1$ and the actual value $a_1$ for the 1st example, and so on. The difference can be positive ($e_1 &gt; a_1$) or negative ($e_1 &lt; a_1$), so usually we square the difference to make it positive number.
The rest is there in the docs. Try putting in concrete imagined values for $a_i$ and $e_i$.