def METHOD_NAME(self, tree):
    for field in tree:
        error_list = tree[field]
        if len(error_list) > 0 and isinstance(tree[field][-1], dict):
            self.METHOD_NAME(tree[field][-1])
        if len(tree[field]) == 1:
            tree[field] = tree[field][0]