'Compiles and returns the task list for this play, compiled from the
roles (which are themselves compiled recursively) and/or the list of
tasks specified in the play.'

def compile(self):

    flush_block = Block.load(data={'meta': 'flush_handlers'}, play=self, variable_manager=self._variable_manager, loader=self._loader)
    block_list = []
    block_list.extend(self.pre_tasks)
    block_list.append(flush_block)
    block_list.extend(self._compile_roles())
    block_list.extend(self.tasks)
    block_list.append(flush_block)
    block_list.extend(self.post_tasks)
    block_list.append(flush_block)
    return block_list
