Returns true if the predicate evaluates to true for any element of the iterable.
Returns false if the iterable is empty or if no elements return true for the predicate.
430067
public static <T> boolean anySatisfy(Iterable<T> iterable, Predicate<? super T> predicate)
    {
        if (iterable instanceof RichIterable)
        {
            return ((RichIterable<T>) iterable).anySatisfy(predicate);
        }
        if (iterable instanceof ArrayList)
        {
            return ArrayListIterate.anySatisfy((ArrayList<T>) iterable, predicate);
        }
        if (iterable instanceof RandomAccess)
        {
            return RandomAccessListIterate.anySatisfy((List<T>) iterable, predicate);
        }
        if (iterable != null)
        {
            return IterableIterate.anySatisfy(iterable, predicate);
        }
        throw new IllegalArgumentException("Cannot perform an anySatisfy on null");
    }
387380
public boolean isSet() {
    for (int i = 0; i < counts.length; ++i) {
      if (counts[i] != 0) {
        return true;
      }
    }
    return false;
  }
780508
def el_is_empty(el):
    """"""
    if len(el) == 1 and not isinstance(el[0], (list, tuple)):
        return True
    subels_are_empty = []
    for subel in el:
        if isinstance(subel, (list, tuple)):
            subels_are_empty.append(el_is_empty(subel))
        else:
            subels_are_empty.append(not bool(subel))
    return all(subels_are_empty)
838975
public boolean hasNext()
  {
    if (tc.isEntryEnabled()) Tr.entry(tc, "hasNext",this);

    boolean hasNext = false;

    if ( (!_empty) && ( (_singleObject != null)                          ||
                        ((_iterator1 != null) && (_iterator1.hasNext())) ||
                        ((_iterator2 != null) && (_iterator2.hasNext()))  ) )
    {
      hasNext = true;
    }

    if (tc.isEntryEnabled()) Tr.exit(tc, "hasNext",new Boolean(hasNext));
    return hasNext;
  }
905961
private boolean isPredicateKnown_(int predicate) {
        assert(m_scl.charAt(predicate) != '*');

        if (m_matrix[predicate] == -2)
            return false;

        if (m_matrix[predicate] == -1)
        {
            m_perform_predicates[predicate] = false;
            m_predicate_count--;
            return true;
        }

        if (m_scl.charAt(predicate) != 'T' && m_scl.charAt(predicate) != 'F')
        {
            if (m_matrix[predicate] < m_max_dim[predicate])
            {
                return false;
            }
            else
            {
                m_perform_predicates[predicate] = false;
                m_predicate_count--;
                return true;
            }
        }
        else
        {
            m_perform_predicates[predicate] = false;
            m_predicate_count--;
            return true;
        }
	}
992552
def is_iterable(value):
    """"""
    return isinstance(value, np.ndarray) or isinstance(value, list) or isinstance(value, tuple), value
361607
public boolean any()
    {
        int l = bits/8;
        for (int ii=0;ii<l;ii++)
        {
            if (array[ii] != 0)
            {
                return true;
            }
        }
        for (int ii=l*8;ii<bits;ii++)
        {
            if (isSet(ii))
            {
                return true;
            }
        }
        return false;
    }
467482
public static boolean contains(Iterable<?> iterable, Object value)
    {
        if (iterable instanceof Collection)
        {
            return ((Collection<?>) iterable).contains(value);
        }
        if (iterable instanceof RichIterable)
        {
            return ((RichIterable<?>) iterable).contains(value);
        }
        return IterableIterate.detectIndex(iterable, Predicates.equal(value)) > -1;
    }
413076
def contains(self, element, key=lambda x: x):
        
        return self.select(key).any(lambda x: x == key(element))
396394
public static <T> T detectIfNone(Iterable<T> iterable, Predicate<? super T> predicate, T ifNone)
    {
        T result = Iterate.detect(iterable, predicate);
        return result == null ? ifNone : result;
    }
40006
public static <T> boolean removeIf(Iterable<T> iterable, Predicate<? super T> predicate)
    {
        if (iterable instanceof MutableCollection)
        {
            return ((MutableCollection<T>) iterable).removeIf(predicate);
        }
        if (iterable instanceof ArrayList)
        {
            return ArrayListIterate.removeIf((ArrayList<T>) iterable, predicate);
        }
        if (iterable instanceof List)
        {
            return ListIterate.removeIf((List<T>) iterable, predicate);
        }
        if (iterable != null)
        {
            return IterableIterate.removeIf(iterable, predicate);
        }
        throw new IllegalArgumentException("Cannot perform a remove on null");
    }
579702
public static <T, P> int detectIndexWith(
            Iterable<T> iterable,
            Predicate2<? super T, ? super P> predicate,
            P parameter)
    {
        if (iterable instanceof ArrayList<?>)
        {
            return ArrayListIterate.detectIndexWith((ArrayList<T>) iterable, predicate, parameter);
        }
        if (iterable instanceof List<?>)
        {
            return ListIterate.detectIndexWith((List<T>) iterable, predicate, parameter);
        }
        if (iterable != null)
        {
            return IterableIterate.detectIndexWith(iterable, predicate, parameter);
        }
        throw new IllegalArgumentException("Cannot perform detectIndexWith on null");
    }
284377
function _checkPredicates (checkAll) {
    return function (predicates) {
        if (!Array.isArray(predicates)) {
            throw _makeTypeErrorFor(predicates, "array");
        }

        return function () {
            for (var i = 0, len = predicates.length, result; i < len; i++) {
                result = predicates[i].apply(this, arguments);

                if (checkAll && !result) {
                    return false;
                } else if (!checkAll && result) {
                    return true;
                }
            }

            return checkAll;
        };
    };
}
940453
private boolean hasNextLazy() {
        try {
            while (true) {
                switch (this.queryState) {
                    case REGULAR:
                        if (this.elements != null) {
                            return true;
                        } else {
                            if (this.queryResult != null) {
                                iterateRegularQueries();
                                this.first = false;
                            }
                            if (this.elements == null) {
                                closePreparedStatement();
                                //try the next distinctQueryStack
                                if (this.distinctQueriesIterator.hasNext()) {
                                    this.currentDistinctQueryStack = this.distinctQueriesIterator.next();
                                    this.subQueryStacks = SchemaTableTree.splitIntoSubStacks(this.currentDistinctQueryStack);
                                    this.currentRootSchemaTableTree.resetColumnAliasMaps();
                                    //if there are duplicates in the stack we can not execute drop steps.
                                    //execute the query as per normal and the proper DropStep will do the rest.
                                    if (this.currentDistinctQueryStack.getLast().isDrop() && !this.currentRootSchemaTableTree.duplicatesInStack(currentDistinctQueryStack)) {
                                        executeDropQuery();
                                    } else {
                                        executeRegularQuery();
                                    }
                                    this.first = true;
                                } else {
                                    //try the next rootSchemaTableTree
                                    if (this.rootSchemaTableTreeIterator.hasNext()) {
                                        this.currentRootSchemaTableTree = this.rootSchemaTableTreeIterator.next();
                                        this.distinctQueriesIterator = this.currentRootSchemaTableTree.constructDistinctQueries().iterator();
                                    } else {
                                        if (this.currentRootSchemaTableTree != null) {
                                            this.currentRootSchemaTableTree.resetColumnAliasMaps();
                                        }
                                        this.queryState = QUERY.OPTIONAL;
                                        this.rootSchemaTableTreeIterator = this.rootSchemaTableTrees.iterator();
                                        break;
                                    }
                                }
                            }
                        }
                        break;
                    case OPTIONAL:
                        if (this.elements != null) {
                            return true;
                        } else {
                            if (this.queryResult != null) {
                                iterateOptionalQueries();
                                this.first = false;
                            }
                            if (this.elements == null) {
                                closePreparedStatement();
                                //try the next distinctQueryStack
                                if (this.optionalLeftJoinResultsIterator.hasNext()) {
                                    this.optionalCurrentLeftJoinResult = this.optionalLeftJoinResultsIterator.next();
                                    this.subQueryStacks = SchemaTableTree.splitIntoSubStacks(this.optionalCurrentLeftJoinResult.getLeft());
                                    this.currentRootSchemaTableTree.resetColumnAliasMaps();
                                    executeOptionalQuery();
                                    this.first = true;
                                } else {
                                    //try the next rootSchemaTableTree
                                    if (this.rootSchemaTableTreeIterator.hasNext()) {
                                        this.currentRootSchemaTableTree = this.rootSchemaTableTreeIterator.next();
                                        List<Pair<LinkedList<SchemaTableTree>, Set<SchemaTableTree>>> leftJoinResult = new ArrayList<>();
                                        SchemaTableTree.constructDistinctOptionalQueries(this.currentRootSchemaTableTree, leftJoinResult);
                                        this.optionalLeftJoinResultsIterator = leftJoinResult.iterator();
                                    } else {
                                        if (this.currentRootSchemaTableTree != null) {
                                            this.currentRootSchemaTableTree.resetColumnAliasMaps();
                                        }
                                        this.queryState = QUERY.EMIT;
                                        this.rootSchemaTableTreeIterator = this.rootSchemaTableTrees.iterator();
                                        break;
                                    }
                                }
                            }
                        }
                        break;
                    case EMIT:
                        if (this.elements != null) {
                            return true;
                        } else {
                            if (this.queryResult != null) {
                                iterateEmitQueries();
                                this.first = false;
                            }
                            if (this.elements == null) {
                                closePreparedStatement();
                                //try the next distinctQueryStack
                                if (this.emitLeftJoinResultsIterator.hasNext()) {
                                    this.emitCurrentLeftJoinResult = this.emitLeftJoinResultsIterator.next();
                                    this.subQueryStacks = SchemaTableTree.splitIntoSubStacks(this.emitCurrentLeftJoinResult);
                                    this.currentRootSchemaTableTree.resetColumnAliasMaps();
                                    executeEmitQuery();
                                    this.first = true;
                                } else {
                                    //try the next rootSchemaTableTree
                                    if (this.rootSchemaTableTreeIterator.hasNext()) {
                                        this.currentRootSchemaTableTree = this.rootSchemaTableTreeIterator.next();
                                        List<LinkedList<SchemaTableTree>> leftJoinResult = new ArrayList<>();
                                        SchemaTableTree.constructDistinctEmitBeforeQueries(this.currentRootSchemaTableTree, leftJoinResult);
                                        this.emitLeftJoinResultsIterator = leftJoinResult.iterator();
                                        if (currentRootSchemaTableTree.isFakeEmit()) {
                                            List<Emit<SqlgElement>> fake = new ArrayList<>();
                                            fake.add(new Emit<>());
                                            this.elements = fake;
                                            this.currentRootSchemaTableTree.setFakeEmit(false);
                                        }
                                    } else {
                                        if (this.currentRootSchemaTableTree != null) {
                                            this.currentRootSchemaTableTree.resetColumnAliasMaps();
                                        }
                                        return false;
                                    }
                                }
                            }
                        }
                        break;
                }
            }
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
618170
public boolean every(Func1<? super T, Boolean> predicate) {
        for (T item : this) {
            if (!predicate.call(item))
                return false;
        }
        return true;
    }
253767
public static boolean hasSameComparator(Comparator<?> comparator, Iterable<?> elements) {
    checkNotNull(comparator);
    checkNotNull(elements);
    Comparator<?> comparator2;
    if (elements instanceof SortedSet) {
      comparator2 = comparator((SortedSet<?>) elements);
    } else if (elements instanceof SortedIterable) {
      comparator2 = ((SortedIterable<?>) elements).comparator();
    } else {
      return false;
    }
    return comparator.equals(comparator2);
  }
233626
function contains( element ) {
    for( var i = 0, len = lists.length; i < len; i++ ) {
      if( lists[i].element == element ) {
        return true;
      }
    }
    return false;
  }