:returns: ``True`` if the node is a sibling of another node given as an
            argument, else, returns ``False``

        :param node:

            The node that will be checked as a sibling
509881
def is_sibling_of(self, node):
        
        return self.get_siblings().filter(pk=node.pk).exists()
542202
def is_descendant_of(self, node):
        
        return self.pk in [obj.pk for obj in node.get_descendants()]
653084
public boolean contains(Node node2) {
        if ((getBeginLine() < node2.getBeginLine())
                || ((getBeginLine() == node2.getBeginLine()) && getBeginColumn() <= node2.getBeginColumn())) {
            if (getEndLine() > node2.getEndLine()) {
                return true;
            } else if ((getEndLine() == node2.getEndLine()) && getEndColumn() >= node2.getEndColumn()) {
                return true;
            }
        }
        return false;
    }
414154
def is_probably_builtin(node):
    
    prev = node.prev_sibling
    if prev is not None and prev.type == token.DOT:
        # Attribute lookup.
        return False
    parent = node.parent
    if parent.type in (syms.funcdef, syms.classdef):
        return False
    if parent.type == syms.expr_stmt and parent.children[0] is node:
        # Assignment.
        return False
    if parent.type == syms.parameters or \
            (parent.type == syms.typedargslist and (
            (prev is not None and prev.type == token.COMMA) or
            parent.children[0] is node
            )):
        # The name of an argument.
        return False
    return True
688735
def node_iterator(self):
        
        return iter(self._node_attributes)

	def has_hypernode(self, hypernode):
        """Determines if a specific hypernode is present in the hypergraph.

        :param node: reference to hypernode whose presence is being checked.
        :returns: bool -- true iff the node exists in the hypergraph.

        """
        return hypernode in self._hypernode_attributes
236161
def _is_node_an_element(self, node):
        
        # Try the simplest approach first, works for plain old ElementTree
        if isinstance(node, BaseET.Element):
            return True
        # For cElementTree we need to be more cunning (or find a better way)
        if hasattr(node, 'makeelement') and isinstance(node.tag, basestring):
            return True
138034
function isBlockNode(node) {
        return node &&
            ((node.nodeType == 1 && !/^(inline(-block|-table)?|none)$/.test(getComputedDisplay(node))) ||
            node.nodeType == 9 || node.nodeType == 11);
    }
194968
public boolean matches(final Node node) {
        if (node.getNodeType() == Node.ELEMENT_NODE) {
            return matches(((Element) node).getAttribute(ATTRIBUTE_NAME_CLASS));
        }
        return false;
    }
988949
function isMultiplicationOfEqualNodes(node) {
  if (!Node.Type.isOperator(node) || node.op !== '*') {
    return false;
  }

  // return if they are all equal nodes
  return node.args.reduce((a, b) => {
    return a.equals(b);
  });

}
1040772
public static boolean isLeaf(Node node) {
        return node instanceof Leaf || node.children() == null || node.children().size() == 0;
    }
595195
function isBlockNode(node) {
	return node
		&& ((node.nodeType == Node.ELEMENT_NODE && ["inline", "inline-block", "inline-table", "none"].indexOf(getComputedStyle(node).display) == -1)
		|| node.nodeType == Node.DOCUMENT_NODE
		|| node.nodeType == Node.DOCUMENT_FRAGMENT_NODE);
}
443909
def find(node):
    
    if node.parent is None:
        return node
    root = node
    while root.parent is not None:
        root = root.parent
    parent = node
    while parent.parent is not root:
        grandparent = parent.parent
        parent.parent = root
        parent = grandparent
    return root
826281
function getSibling(node, relativeIndex) {
  var parent = node.parentNode;
  if (parent === null) {
    return null;
  }
  var currentIndex = parent.childNodes.indexOf(node);
  var siblingIndex = currentIndex + relativeIndex;
  if (siblingIndex < 0 || siblingIndex > parent.childNodes.length - 1) {
    return null;
  }
  return parent.childNodes[siblingIndex];
}
1357366
private boolean bfsComparison(Node root, Node other) {
        if(root instanceof Content || other instanceof Content) {
            return root.equals(other);
        }
        if(! root.equals(other)) {
            return false;
        }

        List<Node> a = ((Element)root).getChildElements();
        List<Node> b = ((Element)other).getChildElements();
        if(a.size() != b.size()) {
            return false;
        }
        for(int i=0; i<a.size(); i++) {
            if(! a.get(i).equals(b.get(i))) {
                return false;
            }
        }

        for(int i=0; i<a.size(); i++) {
            if(! bfsComparison(a.get(i), b.get(i))) {
                return false;
            }
        }

        return true;
    }
1232686
public static boolean isNodeTheSame(Node node1, Node node2)
  {
    if (node1 instanceof DTMNodeProxy && node2 instanceof DTMNodeProxy)
      return ((DTMNodeProxy)node1).equals((DTMNodeProxy)node2);
    else
      return (node1 == node2);
  }
132966
def node_before(node)
      node.parent.equal? self or
        raise ArgumentError, "node is not a child"
      fields = self.fields
      i = node.instance_variable_get(:@parent_field).index - 1
      i.downto(0) do |i|
        f = fields[i]
        if f.child? && (val = self.send(f.reader))
          return val
        end
      end
      return nil
    end
356655
def is_loop_helper(node):
    
    return hasattr(node, 'node') and isinstance(node.node, nodes.Name) and node.node.name == 'loop'