def METHOD_NAME(self):
    node_objs = [node['node_object'] for node in self.get_root_nodes()]
    node_objs_visited = set([])
    path = set([])
    stack = node_objs
    res = False
    if len(self.nodes) != 0 and len(node_objs) == 0:
        return True
    while stack:
        node_obj = stack.pop()
        children = [node['node_object'] for node in self.get_children(node_obj)]
        children_to_add = list(filter(lambda node_obj: node_obj not in node_objs_visited, children))
        if children_to_add:
            if node_obj in path:
                res = True
                break
            path.add(node_obj)
            stack.append(node_obj)
            stack.extend(children_to_add)
        else:
            node_objs_visited.add(node_obj)
            path.discard(node_obj)
    return res