Python to Lua code conversion