Get a dictionary of the contextualize_items grouped by the step or the default value

def get_contextualize_items_by_step(self, default=None):
        """Get a dictionary of the contextualize_items grouped by the step or the default value"""
        if self.items:
            res = {}
            for elem in self.items.values():
                if elem.num in res:
                    res[elem.num].append(elem)
                else:
                    res[elem.num] = [elem]
            return res
        else:
            return default