Plex python errors

I’m trying to use the inbuilt python function sum() in my plex agent. I’m on a Mac.
https://docs.python.org/2.7/library/functions.html#sum

But I get the following error:

NameError: name ‘sum’ is not defined

I output the version of Python used by plex.

2.7.17

I’m a bit surprised that plex is stuck on 2.7 given it EOL’d in 2020 and security fixes aren’t even available for it anymore.

Not sure why the inbuilt function can’t be accessed.
I pulled the code out of my agent and put it in a normal python file and it runs great. Here is the code:

print(sum([1,2]));

My plugin is using Natural Language Processing and takes a long time. It currently NEVER finishes even if I code around the sum error. Is there some timeout configuration for agents?

I think the same can be said of Plex. But here we are. I would still appreciate tips and pointers.