I don't think you can calculate E^2 without the "true model", which you practically never have. The code uses the "true model" too: https://github.com/johnmyleswhite/r_squared/blob/master/util...
I guess the post is similar to Anscombe's quartet [1]: a warning not to blindly trust summary statistics.