'Return the path back to top level from comment.
Restrict the path to a maximum of `context` levels deep.'

@classmethod
def get_path_to_comment(cls, comment, context, comment_tree):

    if (comment._id not in comment_tree.cids):
        raise InconsistentCommentTreeError
    comment_id = comment._id
    path = []
    while (comment_id and (len(path) <= context)):
        path.append(comment_id)
        try:
            comment_id = comment_tree.parents[comment_id]
        except KeyError:
            raise InconsistentCommentTreeError
    path.reverse()
    return path
