<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def todo_tasks(self):
 """Return tasks in loop which its state is pending."""

        tasks = [task for task in self.all_tasks if task._state == NewTask._PENDING]
        return tasks