<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run_task(self, name):
 """Run a task."""


        if name in self.tasks_run:
            yield events.skipping_task(name)
        else:
            yield events.finding_task(name)

            try:
                task = self.find_task(name)
            except NoSuchTaskError as e:
                yield events.task_not_found(name, e.similarities)
                raise StopTask

            yield events.starting_task(task)

            for name in task.dependencies:
                yield from self.run_task(name)

            self.tasks_run.append(name)

            yield events.running_task(task)
            yield from self.run_task_steps(task)
            yield events.finished_task(task)