<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(function, name):
 """ Execute a task, returning a TaskResult """

    try:
        return TaskResult(name, True, None, function())
    except Exception as exc:
        return TaskResult(name, False, exc, None)