Determines whether the <i>cycle</i> is essential.

@param candidate a cycle which is a member of the MCB
@param relevant  relevant cycles of the same length as <i>cycle</i>
@return whether the candidate is essential
552087
private boolean isEssential(final Cycle candidate, final Collection<Cycle> relevant) {

        // construct an alternative basis with all equal weight relevant cycles
        final List<Cycle> alternate = new ArrayList<Cycle>(relevant.size() + basis.size());

        final int weight = candidate.length();
        for (final Cycle cycle : basis.members()) {
            if (cycle.length() < weight) alternate.add(cycle);
        }
        for (final Cycle cycle : relevant) {
            if (!cycle.equals(candidate)) alternate.add(cycle);
        }

        // if the alternate basis is smaller, the candidate is essential
        return BitMatrix.from(alternate).eliminate() < basis.size();
    }
908902
public boolean containsContextsWithACModel(AbstractACModel acModel) {
        for (ProcessContext context : getComponents()) {
            if (context.getACModel().equals(acModel)) {
                return true;
            }
        }
        return false;
    }
526804
def contains_relevant_concept(
    s: Influence, relevant_concepts: List[str], cutoff=0.7
) -> bool:
    

    return any(
        map(lambda c: contains_concept(s, c, cutoff=cutoff), relevant_concepts)
    )
717442
@Override
    public boolean forEachEntryWhile(Predicate<? super SetEntry<E>> predicate) {
        Objects.requireNonNull(predicate);
        return m.forEachEntryWhile(e -> predicate.test(((SetEntry<E>) e)));
    }
1271104
@Override
    public ListT<W,T> cycleWhile(final Predicate<? super T> predicate) {

        return (ListT<W,T>) FoldableTransformerSeq.super.cycleWhile(predicate);
    }
1312910
public static boolean matchAny(final String pattern, final String[] candidate, boolean ignoreCase) {

        for (int i = 0; i < candidate.length; i++) {
            final String string = candidate[i];
            if (match(pattern, string, ignoreCase)) {
                return true;
            }
        }

        return false;
    }
674893
public static List<ByteBuffer> minComponents(List<ByteBuffer> minSeen, Composite candidate, CellNameType comparator)
    {
        // For a cell name, no reason to look more than the clustering prefix
        // (and comparing the collection element would actually crash)
        int size = Math.min(candidate.size(), comparator.clusteringPrefixSize());

        if (minSeen.isEmpty())
            return getComponents(candidate, size);

        // In most case maxSeen is big enough to hold the result so update it in place in those cases
        minSeen = maybeGrow(minSeen, size);

        for (int i = 0; i < size; i++)
            minSeen.set(i, min(minSeen.get(i), candidate.get(i), comparator.subtype(i)));

        return minSeen;
    }
1258067
def candidate(cls):
        """"""
        return relationship(
            "Candidate",
            backref=backref(
                camel_to_under(cls.__name__) + "s",
                cascade="all, delete-orphan",
                cascade_backrefs=False,
            ),
            cascade_backrefs=False,
        )
1075153
public String assignFoundation(IceCandidate candidate) {
		String identifier = computeIdentifier(candidate);
		synchronized (this.foundations) {
			String foundation = this.foundations.get(identifier);
			if (foundation == null) {
				this.currentFoundation++;
				foundation = String.valueOf(this.currentFoundation);
				this.foundations.put(identifier, foundation);
			}
			candidate.setFoundation(foundation);
			return foundation;
		}
	}
1214703
public static boolean isAssignableFrom(String lookingFor, TypeDescriptor candidate) {
		String[] interfaces = candidate.getSuperinterfacesName();
		for (String intface : interfaces) {
			if (intface.equals(lookingFor)) {
				return true;
			}
			boolean b = isAssignableFrom(lookingFor, candidate.getTypeRegistry().getDescriptorFor(intface));
			if (b) {
				return true;
			}
		}
		String supertypename = candidate.getSupertypeName();
		if (supertypename == null) {
			return false;
		}
		if (supertypename.equals(lookingFor)) {
			return true;
		}
		return isAssignableFrom(lookingFor, candidate.getTypeRegistry().getDescriptorFor(supertypename));
	}
12055
function getFirstViableCandidate(candidates) {
    for( const candidate of candidates) {
        const fileJS = `${candidate}.js`;
        if( Fs.existsSync(fileJS) ) return candidate;
        const fileXJS = `${candidate}.xjs`;
        if( Fs.existsSync(fileXJS) ) return candidate;
    }

    return candidates[0];
}
425550
private boolean isAcceptableCandidate(int targetLength, ViterbiNode glueBase, ViterbiNode candidate) {
        return (glueBase == null || candidate.getSurface().length() < glueBase.getSurface().length())
                        && candidate.getSurface().length() >= targetLength;
    }
645277
private static boolean needIncrement(MutableBigInteger mdivisor, int roundingMode,
                                         int qsign, MutableBigInteger mq, MutableBigInteger mr) {
        assert !mr.isZero();
        int cmpFracHalf = mr.compareHalf(mdivisor);
        return commonNeedIncrement(roundingMode, qsign, cmpFracHalf, mq.isOdd());
    }
572972
private static boolean hasMethod(JavaClass c, Method candidateMethod) {
		String name = candidateMethod.getName();
		String sig = candidateMethod.getSignature();

		for (Method method : c.getMethods()) {
			if (!method.isStatic() && method.getName().equals(name) && method.getSignature().equals(sig)) {
				return true;
			}
		}

		return false;
	}
1368015
@SuppressWarnings({"checkstyle:npathcomplexity", "checkstyle:cyclomaticcomplexity"})
	protected boolean isIgnorableCallToFeature(ILinkingCandidate candidate) {
		final JvmIdentifiableElement feature = candidate.getFeature();
		//
		// @Deprecated
		//
		if (feature instanceof JvmOperation) {
			JvmAnnotationTarget target = (JvmOperation) feature;
			JvmAnnotationReference reference = this.annotationLookup.findAnnotation(target, Deprecated.class);
			if (reference == null) {
				do {
					target = EcoreUtil2.getContainerOfType(target.eContainer(), JvmAnnotationTarget.class);
					if (target != null) {
						reference = this.annotationLookup.findAnnotation(target, Deprecated.class);
					}
				} while (reference == null && target != null);
			}
			if (reference != null) {
				return true;
			}
		}
		return false;
	}
1006692
private boolean shouldAcceptMastership(MemberMap memberMap, MemberImpl candidate) {
        assert lock.isHeldByCurrentThread() : "Called without holding cluster service lock!";
        for (MemberImpl member : memberMap.headMemberSet(candidate, false)) {
            if (!membershipManager.isMemberSuspected(member.getAddress())) {
                if (logger.isFineEnabled()) {
                    logger.fine("Should not accept mastership claim of " + candidate + ", because " + member
                            + " is not suspected at the moment and is before than " + candidate + " in the member list.");
                }

                return false;
            }
        }
        return true;
    }
1259698
private void processPostStartRequirements(ConditionContext context, AnnotationValue<Requires> requirements) {
        processPreStartRequirements(context, requirements);

        if (context.isFailing()) {
            return;
        }

        if (!matchesPresenceOfBeans(context, requirements)) {
            return;
        }

        if (!matchesAbsenceOfBeans(context, requirements)) {
            return;
        }

        matchesCustomConditions(context, requirements);
    }