Check if the parent node exists
4618
function create_node_in_parent(error, parentDirectoryNode) {
    if(error) {
      callback(error);
    } else if(parentDirectoryNode.type !== NODE_TYPE_DIRECTORY) {
      callback(new Errors.ENOTDIR('a component of the path prefix is not a directory', path));
    } else {
      parentNode = parentDirectoryNode;
      find_node(context, path, check_if_node_exists);
    }
  }
51487
function check(node, index, parent) {
    var url = node.url

    if ('identifier' in node) {
      url = references(node.identifier)
      url = url && url.url
    }

    if (badge(url)) {
      if (parent.type === 'link' || parent.type === 'linkReference') {
        remove.push(parent)
      } else {
        remove.push(node)
      }
    }
  }
204419
def visit_ifexp(self, node, parent):
        """"""
        newnode = nodes.IfExp(node.lineno, node.col_offset, parent)
        newnode.postinit(
            self.visit(node.test, newnode),
            self.visit(node.body, newnode),
            self.visit(node.orelse, newnode),
        )
        return newnode
734285
function closest (el, sel) {
  if (!el) return
  if (matches(el, sel)) {
    return el
  } else {
    return closest(el.parentNode, sel)
  }
}
774109
function findParent(node) {
  // TODO: It may be a good idea to cache this to prevent unnecessary DOM
  // traversal, but caching is difficult to do correctly without using a
  // mutation observer to listen for all DOM changes.
  var nodeID = ReactMount.getID(node);
  var rootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);
  var container = ReactMount.findReactContainerForID(rootID);
  var parent = ReactMount.getFirstReactDOM(container);
  return parent;
}
1183917
function isBinding(node, parent) {
  var keys = _retrievers.getBindingIdentifiers.keys[parent.type];
  if (keys) {
    for (var i = 0; i < keys.length; i++) {
      var key = keys[i];
      var val = parent[key];
      if (Array.isArray(val)) {
        if (val.indexOf(node) >= 0) return true;
      } else {
        if (val === node) return true;
      }
    }
  }

  return false;
}
682886
function checkParentNodeModules(cb) {
    parentNodeModules = getParentNodeModules();

    // Check if a node_modules folder exists in any folder from the one above.
    // to top /.
    if (parentNodeModules.length) {
        let str;
        str = 'A "node_modules" folder was detected in ';
        str += parentNodeModules.length === 1 ? 'a parent directory: ' :
            'these parent directories: ';
        warn(str);
        parentNodeModules.forEach(dir => logList(dir));
        log();

        str = 'If you continue, ' + (parentNodeModules.length === 1 ?
                                     'that folder' : 'those folders');
        log(str + ' will be temporarily renamed. This');
        log('might affect only live node processes. If unsure, choose No ');
        log('and try to install nodeGame on another path.');
        log();
        if (!yes) {
            confirm('Continue? [y/n]', function(ok) {
                if (ok) {
                    log();
                    let res = renameParentNodeModules(parentNodeModules);
                    if (res !== true) {
                        err('Could not rename ' + res[0]);
                        installationFailed();
                    }
                    log();
                    doInstall();
                }
                else {
                    installationAborted(true);
                    return;
                }
            });
        }
        else {
            log('Continue? [y/n] --yes');
            log();
        }
    }
    else {
        doInstall();
    }
}
950686
function (node, pred) {
            node = node.parentNode;

            while (node) {
                if (nodeLength(node) !== 1) { break; }
                if (pred(node)) { return node; }
                if (isEditable(node)) { break; }

                node = node.parentNode;
            }
            return null;
        }
886682
def get_node(self, key):
    """"""
    if key in self.names:
      return self.values.get_member_node(key) if hasattr(self.values, 'get_member_node') else None
    return self.parent.get_node(key)
559788
function containsDeep(parent, child) {
        var node = child;
        while (node) {
            if (node == parent) return true;

            node = getParentNode(node);
        }
        return false;
    }
899108
def visit_compare(self, node, parent):
        """"""
        newnode = nodes.Compare(node.lineno, node.col_offset, parent)
        newnode.postinit(
            self.visit(node.left, newnode),
            [
                (self._cmp_op_classes[op.__class__], self.visit(expr, newnode))
                for (op, expr) in zip(node.ops, node.comparators)
            ],
        )
        return newnode
140050
function containsNode(outerNode, innerNode) {
  if (!outerNode || !innerNode) {
    return false;
  } else if (outerNode === innerNode) {
    return true;
  } else if (isTextNode(outerNode)) {
    return false;
  } else if (isTextNode(innerNode)) {
    return containsNode(outerNode, innerNode.parentNode);
  } else if (outerNode.contains) {
    return outerNode.contains(innerNode);
  } else if (outerNode.compareDocumentPosition) {
    return !!(outerNode.compareDocumentPosition(innerNode) & 16);
  } else {
    return false;
  }
}
489363
def get_parent_id(element):
        """"""
        if 'parent' in element.attrib:
            return element.attrib['parent']
        else:
            return element.getparent().attrib[add_ns('id')]
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
1166573
function checkParent( elem ) {
    // not needed if already has parent
    if ( elem.parentNode ) {
      return;
    }
    var fragment = document.createDocumentFragment();
    fragment.appendChild( elem );
  }
249433
def checkNode(self, namespaceURI=None, localName=None):
        '''
            
        '''
        namespaceURI = namespaceURI or self.namespaceURI
        localName = localName or self.name
        check = False
        if localName and self.node:
            check = self._dom.isElement(self.node, localName, namespaceURI)
        if not check:
            raise NamespaceError, 'unexpected node type %s, expecting %s' %(self.node, localName)
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