lys_ingrouping(const struct lys_node *node)
{
    const struct lys_node *iter = node;
    assert(node);

    iter = node;
    while (iter && iter->nodetype != LYS_GROUPING) {
        if (iter->parent && (iter->parent->nodetype == LYS_AUGMENT) && iter->parent->parent) {
            /* for augments in uses, we do not care about the target */
            iter = iter->parent->parent;
        } else {
            iter = lys_parent(iter);
        }
    }
    if (!iter) {
        return 0;
    } else {
        return 1;
    }
}
lys_ingrouping(const struct lys_node *node)
{
    const struct lys_node *iter = node;
    assert(node);

    iter = node;
    while (iter && iter->nodetype != LYS_GROUPING) {
        if (iter->parent && (iter->parent->nodetype == LYS_AUGMENT) && iter->parent->parent) {
             
            iter = iter->parent->parent;
        } else {
            iter = lys_parent(iter);
        }
    }
    if (!iter) {
        return 0;
    } else {
        return 1;
    }
}