Returns a boolean indicating whether this element precedes the other element
771736
def precedes(self, other):
        """"""
        try:
            ancestor = next(commonancestors(AbstractElement, self, other))
        except StopIteration:
            raise Exception("Elements share no common ancestor")
        #now we just do a depth first search and see who comes first
        def callback(e):
            if e is self:
                return True
            elif e is other:
                return False
            return None
        result = ancestor.depthfirstsearch(callback)
        if result is None:
            raise Exception("Unable to find relation between elements! (shouldn't happen)")
        return result
1114185
public boolean hasNext() {

        if (items != null) {
            if (items.hasNext()) {
                return (true);
            } else {
                items = null;
            }
        }
        Object next = findNextValidChild();
        while (next != null) {
            initializeItems(next);
            if (items != null) {
                return true;
            } else {
                next = findNextValidChild();
            }
        }
        return false;

    }
285604
function $and( first ){
        return first.next ? function( thing ){
            var fn = first;
            while ( fn ){

                if ( !fn( thing ) ){
                    return false;
                }
                fn = fn.next;
            }
            return true;
        } : first;
    }
1213893
def find_previous(element, l):
    
    length = len(l)
    for index, current in enumerate(l):
        # current is the last element
        if length - 1 == index:
            return current

        # current is the first element
        if index == 0:
            if element < current:
                return None

        if current <= element < l[index+1]:
            return current
17514
function(element, check, go) {
      var shouldAdd = element.__queue && !element.__queue.check;
      if (shouldAdd) {
        queueForElement(element).push(element);
        element.__queue.check = check;
        element.__queue.go = go;
      }
      return (this.indexOf(element) !== 0);
    }
246599
public boolean isPreviousThan(Node node) {
        if (getEndLine() < node.getBeginLine()) {
            return true;
        } else if ((getEndLine() == node.getBeginLine()) && (getEndColumn() <= node.getBeginColumn())) {
            return true;
        }
        return false;
    }
236454
@Override
    public boolean hasMoreElements() {
        // wind forward to the next non-empty enumeration
        while (index < enumerations.size() && !!!enumerations.get(index).hasMoreElements())
            index++;
        // return true iff there was a non-empty enumeration
        return index < enumerations.size();
    }
1141339
function (other) {
        assertNotNull(other);

        if (this.count() === 0) {
            return false;
        }

        var table = this.table,
            res = false;

        forOf(other, function (element) {
            if (table.contains(element)) {
                res = true;
                return res;
            }
        });

        return res;
    }
169944
@Override
	public boolean next() {
		if (isLhsEmpty)
			return false;
		if (s2.next())
			return true;
		else if (!(isLhsEmpty = !s1.next())) {
			s2.beforeFirst();
			return s2.next();
		} else {
			return false;
		}
	}
506947
public boolean forwardIfCurrentAndNoWordAfter(String str) {
	int c = pos;
	if (forwardIfCurrent(str)) {
	    if (!isCurrentBetween('a', 'z') && !isCurrent('_')) return true;
	}
	pos = c;
	return false;
    }
523246
def element_needs_parens?(element)
      if element.is_a?(ListLiteral)
        return false if element.elements.length < 2
        return false if element.bracketed
        return Sass::Script::Parser.precedence_of(element.separator || :space) <=
               Sass::Script::Parser.precedence_of(separator || :space)
      end

      return false unless separator == :space

      if element.is_a?(UnaryOperation)
        return element.operator == :minus || element.operator == :plus
      end

      return false unless element.is_a?(Operation)
      return true unless element.operator == :div
      !(is_literal_number?(element.operand1) && is_literal_number?(element.operand2))
    end
1363987
public boolean inOrder() {
        SortedSet<Integer> prev = null;
        for (SortedSet<Integer> cell : cells) {
            if (prev == null) {
                prev = cell;
            } else {
                int first = cell.first();
                int last = cell.last();
                if (first > prev.first() && last > prev.last()) {
                    prev = cell;
                } else {
                    return false;
                }
            }
        }
        return true;
    }
387058
public boolean isBefore(T element) {
    if (element == null) { return false; }
    return comparator.compare(element, max) > 0;
  }
213784
protected boolean isLeaf() {

        for (int i = 0; i < entries.length; i++) {
            Entry entry = entries[i];
            if (entry.getChild() != null) {
                return false;
            }
        }

        return true;
    }
1093655
def are_equal_elements(a_el, b_el):
    
    if a_el.tagName != b_el.tagName:
        return False
    if sorted(a_el.attributes.items()) != sorted(b_el.attributes.items()):
        return False
    if len(a_el.childNodes) != len(b_el.childNodes):
        return False
    for a_child_el, b_child_el in zip(a_el.childNodes, b_el.childNodes):
        if a_child_el.nodeType != b_child_el.nodeType:
            return False
        if (
            a_child_el.nodeType == a_child_el.TEXT_NODE
            and a_child_el.data != b_child_el.data
        ):
            return False
        if a_child_el.nodeType == a_child_el.ELEMENT_NODE and not are_equal_elements(
            a_child_el, b_child_el
        ):
            return False
    return True
1084655
public boolean isEndedBy(final T element) {
        if (element == null) {
            return false;
        }
        return comparator.compare(element, maximum) == 0;
    }
119220
static boolean isBefore(Date a, Date b) {
        return a == null || (b != null && b.before(a));
    }