def is_complete(self): _complete = True # all children scopes shall be equal children_scopes = [child.var_scope for child in self.children] # adding this node scope children_scopes.append(self.var_scope) for scope1, scope2 in utils.pairwise(children_scopes): if scope1 != scope2: _complete = False break return _complete