Check that the children we have are allowed here.
9233
def _validate_children(self):
        """"""
        for child in self._children:
            if child.__class__ not in self._allowed_children:
                raise ValueError(
                    "Child %s is not allowed as a children for this %s type entity." % (
                        child, self.__class__
                    )
                )
657964
def has_child(self, child):
        
        if u'children' not in self:
            return False

        if not isinstance(child, basestring):
            child = child.get_id()

        return child in self.children
241665
def validate(self):
        
        for timeperiod, child in self.root.children.items():
            child.validate()
        self.validation_timestamp = datetime.utcnow()
831503
def _check_children(self):
        '''
        
        '''
        while self.up:
            time.sleep(1)
            for process in self._processes:
                if process.is_alive() is True:
                    continue
                log.debug('%s is dead. Stopping the napalm-logs engine.', process.description)
                self.stop_engine()
784713
public function has_children() {
        return ($this->nodetype === navigation_node::NODETYPE_BRANCH || $this->children->count()>0 || $this->isexpandable);
    }
731551
def hasChildren(self, parentIndex=QtCore.QModelIndex()):
        
        parentItem = self.getItem(parentIndex, altItem=self.invisibleRootItem)
        return parentItem.hasChildren()
823449
function()
    {
        if (this._savedChildren)
            return;

        this._savedSelfTime = this.selfTime;
        this._savedTotalTime = this.totalTime;
        this._savedNumberOfCalls = this.numberOfCalls;

        this._savedChildren = this.children.slice();
    }
497164
def _verifyChildren(self, i):
		
		super(Table, self)._verifyChildren(i)
		child = self.childNodes[i]
		if child.tagName == ligolw.Column.tagName:
			self._update_column_info()
		elif child.tagName == ligolw.Stream.tagName:
			# require agreement of non-stripped strings
			if child.getAttribute("Name") != self.getAttribute("Name"):
				raise ligolw.ElementError("Stream name '%s' does not match Table name '%s'" % (child.getAttribute("Name"), self.getAttribute("Name")))
76887
private void checkChildrenCount() {
        if (getChildCount() != 2)
            Log.e(getResources().getString(R.string.tag), getResources().getString(R.string.wrong_number_children_error));
    }
644015
public function checkParent()
    {
        if ($this->id) {
            if ($this->id == $this->parent_id) {
                throw new ParentIsSelfException('Parent should not be self.');
            }

            $tree = $this->getTree($this->id);
            $childrenIds = array_column($tree, 'id');

            if (in_array($this->parent_id, $childrenIds)) {
                throw new ParentIsChildException('Parent should not be child.');
            }
        }

        return $this;
    }
20769
def contains?(child)
      children.any? { |c|
        (c.kind_of?(Layout) && c.contains?(child)) || c == child
      }
    end
834221
private boolean checkParents( boolean exclusive ) {
        if (path.equals("/")) {
            return true;
        }
        if (owner == null) {
            // no owner, checking parents
            return parent != null && parent.checkParents(exclusive);
        }
        // there already is a owner
        return !(this.exclusive || exclusive) && parent.checkParents(exclusive);
    }
275862
public static function check() {
		if (R::count("permission") < 1) {
			$role       = R::dispense("permission");
			$role->name = "guest";
			R::store($role);
		}
	}
1007827
def CheckTotals(self):
        """"""
        staves = self.GetChildrenIndexes()
        for staff in staves:
            child = self.getStaff(staff)
            child.CheckTotals()
314080
def _eq(self, other):
        """"""
        return (self.type, self.children) == (other.type, other.children)
674016
public function hasChildren()
    {
        $item = $this->data[$this->keys[$this->position]];

        return (is_object($item) && $item instanceof \Octris\Db\Type\SubObject);
    }
851662
function check(node) {
            if (TARGET_NODE_TYPE.test(node.parent.type) &&
                isMixedWithParent(node) &&
                !shouldIgnore(node)
            ) {
                reportBothOperators(node);
            }
        }