General Ledger by Script Report


I am trying to create General Ledger (same as standard one) using Script Report.

I have two sections to write the code:
One to write Python syntax where I added the code in

Another to add Javascript code where I put the script in general_ledger.js

There is no problem in Javascript code but the problem comes from Python.

Adding the same code gives me below error

After amending the invalid syntax, I am getting below error

After removing import part in the code, I am getting Nothing to Show

I need to know where the problem is. I think the need code may be a small code of one sentence.

Can someone help? Actually, I need it urgently.

Anyone can help?