Repl Error Code in Tampermonkey

How can I fix this error?

I transferred my code into Tampermonkey. Pls help!

This is what it says:

It looks like your combining JavaScript and python code… Those import statements seem to be trying to import Python modules. The error is just saying you can’t have those import statements inside that function.

How can I solve this?

The error is telling you to do this:

import os
import random
import asyncio
import math
import numpy
from mathparse import mathparse
import urllib.parse as parse
import requests
import re
from keep_alive import keep_alive
import functools
import itertools
import youtube_dl
from async_timeout import timeout

(function() {
// ...

But, I think that will give you an error since you are writing JavaScript code, not Python code…