def has_shape(node):
    allowed_shapes = (
        pm.nt.Mesh,
        pm.nt.NurbsCurve,
        pm.nt.NurbsSurface
    )

    has_it = False

    children = node.getChildren()
    while len(children) and not has_it:
        child = children.pop(0)
        if isinstance(child, allowed_shapes):
            has_it = True
            break
        children += child.getChildren()

    return has_it
checks if the given node has at least one child that has a shape
dataset/ETHPy150Open eoyilmaz/anima/anima/env/mayaEnv/auxiliary.py/has_shape