<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def execute(self, env, args):
 """ Lists all valid tasks. `env` Runtime ``Environment`` instance. `args` Arguments object from arg parser. """


        tasks = env.task.get_list_info()
        if not tasks:
            env.io.write("No tasks found.")

        else:
            if args.verbose:
                _print_tasks(env, tasks, mark_active=True)

            else:
                if env.task.active:
                    active_task = env.task.name
                else:
                    active_task = None

                for task, options, blocks in tasks:
                    if task == active_task:
                        env.io.success(task + ' *')
                    else:
                        if options is None and blocks is None:
                            env.io.error(task + ' ~')
                        else:
                            env.io.write(task)