code: def _lua_to_python(lval, return_status=False):
          
          import lua
          lua_globals = lua.globals()
          if lval is None:
              # Lua None --> Python None
              return None
          if lua_globals.type(lval) == "table":
              # Lua table --> Python list
              pval = []
              for i in lval:
                  if return_status:
                      if i == 'ok':
                          return lval[i]
                      if i == 'err':
                          raise ResponseError(lval[i])
                  pval.append(Script._lua_to_python(lval[i]))
              return pval
          elif isinstance(lval, long):
              # Lua number --> Python long
              return long(lval)
          elif isinstance(lval, float):
              # Lua number --> Python float
              return float(lval)
          elif lua_globals.type(lval) == "userdata":
              # Lua userdata --> Python string
              return str(lval)
          elif lua_globals.type(lval) == "string":
              # Lua string --> Python string
              return lval
          elif lua_globals.type(lval) == "boolean":
              # Lua boolean --> Python bool
              return bool(lval)
          raise RuntimeError("Invalid Lua type: " + str(lua_globals.type(lval)))
docs: Convert Lua object(s) into Python object(s), as at times Lua object(s)
          are not compatible with Python functions