It is showing error on line number 4. Are you using double quotes " " to define the API_KEY variable ?
API_KEY = "xxxxxxxxxx"
Also type the listing command and share the screenshot with us?
Do let me know in case you need further assistance.
i have checked your error , i have also faced the same error then i just put all the alphanumerical variables like - API_KEY , DEVICE_ID , SSID , AUTH_TOKEN in double quotes . and the error gets resolved. so try to do this , may this will work the same in your case also. for further query do let me know. kindly response to the reply ,if your query gets resolved .