human
Solve the following python programming problem given the following code:
@pytest.fixture()
def execute_task(manager):
assistant
#Here is the Python program you requested.

    """A function that can be used to execute and return a named task in `config` argument.
    """
    def execute(task_name, abort=False, options=None):
        u'\n                                Use    to    execute    one    test    task    from    config.\n\n                                :param    abort:    If    `True`    expect    (and    require)    this    task    to    abort.\n                                '
        log.info((u'**********    Running    task:    %s    **********    ' % task_name))
        config = manager.config[u'tasks'][task_name]
        task = Task(manager, task_name, config=config, options=options)
        try:
            if abort:
                with pytest.raises(TaskAbort):
                    task.execute()
            else:
                task.execute()
        finally:
            try:
                task.session.close()
            except Exception:
                pass
        return task
    return execute