def _get_and_update_relay(self, available_offers):
        """
        Get num tasks I should create and evaluate whether to use Relay's
        warmer or cooler command.  Update the MV with number of commands about
        to be created.

        Competes for the MV with these other threads, and will wait
        indefinitely for it:

          - other Mesos resourceOffers(...) calls to the Framework scheduler
          - Relay warmer and cooler functions attempting to ask the Framework
            to execute more tasks.
        """
        command = None
        with self.MV.get_lock():
            MV, t = self.MV
            # create tasks that fulfill relay's requests or return
            if MV == 0:
                log.debug(
                    'mesos scheduler has received no requests from relay',
                    extra=dict(
                        mesos_framework_name=self.ns.mesos_framework_name))
            else:
                if MV > 0 and self.ns.warmer:
                    command = self.ns.warmer
                elif MV < 0 and self.ns.cooler:
                    command = self.ns.cooler
                if len(available_offers) < abs(MV):
                    self.MV[:] = [0, time.time()]
                else:
                    new_MV = MV - (MV > 0 or -1) * max(abs(MV),
                                                       len(available_offers))
                    self.MV[:] = [new_MV, time.time()]
        return (MV, command)
dataset/ETHPy150Open sailthru/relay.mesos/relay_mesos/scheduler.py/Scheduler._get_and_update_relay/swapped operands of `<`