Not sure where the AI generated python is coming from?

AI generated anything is a hellscape.