<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def register_task(self, input, deps=None, manager=None, task_class=None, append=False):
 """ Utility function that generates a `Work` made of a single task Args: input: :class:`AbinitInput` deps: List of :class:`Dependency` objects specifying the dependency of this node. An empy list of deps implies that this node has no dependencies. manager: The :class:`TaskManager` responsible for the submission of the task. If manager is None, we use the :class:`TaskManager` specified during the creation of the work. task_class: Task subclass to instantiate. Default: :class:`AbinitTask` append: If true, the task is added to the last work (a new Work is created if flow is empty) Returns: The generated :class:`Work` for the task, work[0] is the actual task. """

        # append True is much easier to use. In principle should be the default behaviour
        # but this would break the previous API so ...
        if not append:
            work = Work(manager=manager)
        else:
            if not self.works:
                work = Work(manager=manager)
                append = False
            else:
                work = self.works[-1]

        task = work.register(input, deps=deps, task_class=task_class)
        if not append: self.register_work(work)

        return work