Python script

Hi, trying to run a custom python script. I followed This Guide but from logs i see following error:

Logger: homeassistant.components.python_script
Source: components/python_script/
Integration: Python Scripts (documentation, issues)
First occurred: 14:10:48 (1 occurrences)
Last logged: 14:10:48
Error loading script Line 17: AsyncFunctionDef statements are not allowed., Line 31: “name” is an invalid variable name because it starts with “_”

If i try to run this script in a linux box it works.
Is it such a limitation in HA ?

Did you read the document you linked to?

The scripts are run in a sandboxed environment.

It is not possible to use Python imports with this integration. If you want to do more advanced scripts, you can take a look at AppDaemon or pyscript