Can we determine what environment a deluge function is running in (sandbox/production)?

Can we determine what environment a deluge function is running in (sandbox/production)?

Is there way of consistently detecting whether a function is running in the sandbox or production? I was wondering if there was a flag to indicate the sandbox, rather than comparing an org ID variable. 

I took a look at response from zoho.crm.invokeConnector("crm.getorg",Map()) but there's nothing obvious, beyond ID differences, or our sandbox zia_portal_id being null.