def _createTasks(self):
        all_tasks = set(self.tasks)

        selected_tasks = self.options.tasks
        if selected_tasks is None:
            selected_tasks = [t.__name__ for t in all_tasks]

        # Determine which tasks need to be unregistered based on the
        # selected tasks.
        unregister_tasks = [t for t in all_tasks
                            if t.__name__ not in selected_tasks]

        # Unregister non-selected tasks
        for t in unregister_tasks:
            self.tasks.unregister(t)

        # Actually create the tasks
        self.tasks.create(self)

        # Call service initialization hook after tasks have been instantiated,
        # but before they've been initialized.
        self.initService()

        # Initialize the tasks
        self.tasks.init()
dataset/ETHPy150Open facebook/sparts/sparts/vservice.py/VService._createTasks/original