<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _extract_annotations_from_task(self, task):
 """ Removes annotations from a task and returns a list of annotations """

        annotations = list()

        if 'annotations' in task:
            existing_annotations = task.pop('annotations')
            for v in existing_annotations:
                if isinstance(v, dict):
                    annotations.append(v['description'])
                else:
                    annotations.append(v)

        for key in list(task.keys()):
            if key.startswith('annotation_'):
                annotations.append(task[key])
                del(task[key])
        return annotations