Conversion of Magma code into python

Job ID: 32244154

Budget: ₹1,500 – ₹12,500 INR

I have a code file written in Magma (around 116 lines). Can someone please help me in converting into Python or SageMath?
Thanks.

Please find attached the code for your reference.
Related categories: Python Cryptography Mathematics