ARIMA in Spline-Garch Python

I’m working on a spline garch model (Engle-Rangel 2008). I use to work on R, and to be honnest I use to work on R packages and not coding by myself (so shame on me^^). However, to replicate a spline garch model I use a great python code from this website:

I have no problem with using it, but my python skills are a bit rusty!

As a consequence, I waned to know if anyone could help me to introdiuce a moving average (MA) process in this code in order to deal with an ARIMA in the conditional mean process instead of the AR process (mainly the first two blocks of the code that are lag array helper function and detemine the AR errors)

Thanks a lot!