def getSwapUsage(self):
        """
        | Uses psutil module to retrieve usage swap percentage. The value is transmitted as a float in range [0-1]
        :return: A float indicating the amount of swap currently used on the system
        """
        swapUsage = 0.0
        try:
            try:
                swapUsage = psutil.swap_memory().percent
            except psutil.Error:
                LOGGER.warning("An error occured when retrieving swap percentage.")
        except NameError, e:
            LOGGER.debug("Impossible to use psutil module on this host: %r" % e)
        except Exception, e:
            LOGGER.warning("An unexpected error occured: %r" % e)

        return swapUsage
dataset/ETHPy150Open mikrosimage/OpenRenderManagement/src/octopus/worker/worker.py/Worker.getSwapUsage/original