Check if child exists
173352
public function hasChild(string $name): bool
    {
        foreach ($this->children as $node) {
            if (strcasecmp($node->getName(), $name) == 0) {
                return true;
            }
        }

        return false;
    }
19773
def exists(self, key, **opts):
        """"""
        key, store = self._expand_opts(key, opts)
        data = store.get(key)
        # Note that we do not actually delete the thing here as the max_age
        # just for this call may have triggered a False.
        if not data or self._has_expired(data, opts):
            return False
        return True
1346318
public function hasChildren()
    {
        $result = false;

        if(isset($this->__children[$this->id])) {
            $result = (boolean) count($this->__children[$this->id]);
        }

        return $result;
    }
139921
def find_child( method, *args )
      children.find do |child|
        Launchy.log "Checking if class #{child} is the one for #{method}(#{args.join(', ')})}"
        child.send( method, *args )
      end
    end
322532
public function hasChild($key = null, $value = null, Collect $data = null)
    {
        if (func_num_args() < 3) {
            $data = $this->data;
            $key = $this->parent;
            $value = current(func_get_args());
        }

        $child = false;

        $data->each(function ($item) use (&$child, $key, $value) {

            if (intval($item[$key]) == intval($value) && !$child) {
                $child = true;
            }

        });

        return $child;
    }
5568
def is_child_of(self, node):
        
        return node.get_children().filter(pk=self.pk).exists()
760484
def _is_child(self, parent, child):  # type: (str, str) -> bool
        
        parent_parts = tuple(self._split_table_name(parent))
        child_parts = tuple(self._split_table_name(child))

        if parent_parts == child_parts:
            return False

        return parent_parts == child_parts[: len(parent_parts)]
54658
function exists (path, callback) {
    Fs.stat(path, function (err) {
        callback(checkErr(err));
    });
}
1085729
def _is_child_wikicode(self, obj, recursive=True):
        """"""
        def deref(nodes):
            if isinstance(nodes, _ListProxy):
                return nodes._parent  # pylint: disable=protected-access
            return nodes

        target = deref(obj.nodes)
        if target is deref(self.nodes):
            return True
        if recursive:
            todo = [self]
            while todo:
                code = todo.pop()
                if target is deref(code.nodes):
                    return True
                for node in code.nodes:
                    todo += list(node.__children__())
        return False
225222
def _exists(field, value, document):
    
    if value not in (True, False):
        raise MalformedQueryException("'$exists' must be supplied a boolean")

    if value:
        return field in document
    else:
        return field not in document
995678
function(branch, child) {
  // Validate.
  if (!isBranch(branch)) {
    assert(false);
  }
  if (!isBranchOrTask(child)) {
    assert(false);
  }

  // Branch already contains a child with the same name.
  if (branchContainsChild(branch, child)) {
    assert(false);
  }

  // Add child and then sort children.
  branch.children.push(child);
  branch.children.sort(compareBranchOrTask);
}
716988
function checkChildren(mutation, node, seen) {

	var attr,
	    k,
	    l;

	if (seen == null) {
		seen = initial_seen;
	}

	// Ignore text nodes
	if (node.nodeType === 3 || node.nodeType === 8) {
		return;
	}

	// Only check attributes for nodes that haven't been checked before
	if (!seen.get(node)) {

		// Indicate this node has been checked
		seen.set(node, true);

		// Go over every attribute
		if (node.attributes) {
			for (k = 0; k < node.attributes.length; k++) {
				attr = node.attributes[k];

				if (attributes[attr.name]) {
					for (l = 0; l < attributes[attr.name].length; l++) {
						attributes[attr.name][l](node, attr.value, null, true);
					}
				}
			}
		}
	}

	// Now check the children
	for (k = 0; k < node.childNodes.length; k++) {
		checkChildren(mutation, node.childNodes[k], seen);
	}
}
731551
def hasChildren(self, parentIndex=QtCore.QModelIndex()):
        
        parentItem = self.getItem(parentIndex, altItem=self.invisibleRootItem)
        return parentItem.hasChildren()
203836
def relation_exists(self, parent, child, relation_type):
        """"""
        return PIDRelation.query.filter_by(
            child_pid_id=child.id,
            parent_pid_id=parent.id,
            relation_type=relation_type).count() > 0
559788
function containsDeep(parent, child) {
        var node = child;
        while (node) {
            if (node == parent) return true;

            node = getParentNode(node);
        }
        return false;
    }
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()
238278
function exists (filepath, callback) {
  fs.stat(filepath, err => {
    if (err) callback(false)
    else callback(true)
  })
}