def _tasks_for_offer(self, offer):
        tasks = []
        log.info(offer.id.value % "Got resource offer %s")
        try:
            next_job = self.in_memory_queue.pop()
        except IndexError:
            log.info("No jobs, skipping iteration")
            return tasks

        # TODO: This is also stupid... if we have any resource offer
        # we are assinging it one job. Should be some attempt here
        # to size jobs and match them to resources.
        tid = self.tasksLaunched
        self.tasksLaunched += 1

        log.info("Accepting offer on %s to start task %d" % (offer.hostname, tid))

        task = mesos_pb2.TaskInfo()
        task.task_id.value = str(tid)
        task.slave_id.value = offer.slave_id.value
        task.name = "task %d" % tid
        task.executor.MergeFrom(self.executor)

        self._populate_task_data_for_job(task, next_job)

        cpus = task.resources.add()
        cpus.name = "cpus"
        cpus.type = mesos_pb2.Value.SCALAR
        cpus.scalar.value = 1

        mem = task.resources.add()
        mem.name = "mem"
        mem.type = mesos_pb2.Value.SCALAR
        mem.scalar.value = 32

        tasks.append(task)
        self.taskData[task.task_id.value] = (
            offer.slave_id,
            task.executor.executor_id
        )
        return tasks
dataset/ETHPy150Open galaxyproject/pulsar/pulsar/mesos/framework.py/PulsarScheduler._tasks_for_offer/swapped operands of `%`