def register(self, func):
if hasattr(self._tasks, func.__name__):<EOL><INDENT>raise TaskAlreadyRegistered(func.__name__)<EOL><DEDENT>setattr(self._tasks, func.__name__, func)<EOL>return _get_invalid_accessor(func.__name__)<EOL>
Register a task. Typically used as a decorator to the task function.

If a task by that name already exists,
a TaskAlreadyRegistered exception is raised.
:param func: func to register as an ape task
:return: invalid accessor