def invoke_task(task, args):
parser, proxy_args = get_task_parser(task)<EOL>if proxy_args:<EOL><INDENT>return task(*args)<EOL><DEDENT>else:<EOL><INDENT>pargs = parser.parse_args(args)<EOL>return task(**vars(pargs))<EOL><DEDENT>
Parse args and invoke task function.

:param task: task function to invoke
:param args: arguments to the task (list of str)
:return: result of task function
:rtype: object