If we fail to find a good candidate we need to find something else.
166293
def _handle_no_candidates(self):
        
        # since we've not found a good candidate we're should help this
        if self.dom is not None and len(self.dom):
            dom = prep_article(self.dom)
            dom = build_base_document(dom, self._return_fragment)
            return self._remove_orphans(
                dom.get_element_by_id("readabilityBody"))
        else:
            logger.info("No document to use.")
            return build_error_document(self._return_fragment)
1062791
private void pessimisticGetNext(
                                   DeleteStack    stack)
    {
        synchronized(_index)
        {
            internalGetNext(stack, _index.vno(), _index.xno());
            _pessimisticGetNexts++;
        }
    }
1286574
private static String foundCandidatesString(Tuple<Decl.Callable> candidates) {
		ArrayList<String> candidateStrings = new ArrayList<>();
		for (Decl.Callable c : candidates) {
			candidateStrings.add(candidateString(c, null));
		}
		Collections.sort(candidateStrings); // make error message deterministic!
		StringBuilder msg = new StringBuilder();
		for (String s : candidateStrings) {
			msg.append("\n\tfound ");
			msg.append(s);
		}
		return msg.toString();
	}
1140069
private void evict(Node candidate) {
    if (data.size() > maximumSize) {
      Node evict;
      Node victim = head.next;
      if (admittor.admit(candidate.key, victim.key)) {
        evict = victim;
      } else if (adapt(candidate)) {
        evict = victim;
      } else {
        evict = candidate;
        feedback.put(candidate.key);
      }
      data.remove(evict.key);
      evict.remove();

      policyStats.recordEviction();
    }
  }
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];
}
1224980
def get_candidate_election(self, candidate):
        """"""
        return CandidateElection.objects.get(
            candidate=candidate, election=self
        )
281199
def get_candidates(self):
        """"""
        candidate_elections = CandidateElection.objects.filter(election=self)

        return [ce.candidate for ce in candidate_elections]
535944
def _find_file(self, needle, candidates):
        """"""
        for candidate in candidates:
            fullpath = os.path.join(candidate, needle)
            if os.path.isfile(fullpath):
                return fullpath
        raise PathError("Unable to locate file %s; tried %s" % (needle, candidates))
1012329
def process(self, candidates):
        
        return sorted(candidates, key=attrgetter('score'), reverse=self.reverse)
1111910
def fail(self, reason, obj, pointer=None):
        
        pointer = pointer_join(pointer)
        err = ValidationError(reason, obj, pointer)
        if self.fail_fast:
            raise err
        else:
            self.errors.append(err)
        return err
506501
def _exclude_on_fail(self, df):
        """"""
        idx = df if isinstance(df, pd.MultiIndex) else _meta_idx(df)
        self.meta.loc[idx, 'exclude'] = True
        logger().info('{} non-valid scenario{} will be excluded'
                      .format(len(idx), '' if len(idx) == 1 else 's'))
518359
def replace_with(self, other):
        """"""
        self.after(other)
        self.parent.pop(self._own_index)
        return other
524416
public boolean shouldRetryFor(Class<E> candidate) {
    Preconditions.checkNotNull(candidate, "Requires a non-null candidate class");
    if (dontRetry != null) {
      return !dontRetry.contains(candidate);
    } else {
      return true;
    }
  }
1255336
def fail(self, msg, lineno):
        """"""
        raise TemplateAssertionError(msg, lineno, self.name, self.filename)
435938
def get_or_create_candidate_election(
        self, row, election, candidate, party
    ):
        
        return election.update_or_create_candidate(
            candidate, party.aggregate_candidates, row["uncontested"]
        )
581332
def find_candidates(document):
    
    nodes_to_score = set()
    should_remove = set()

    for node in document.iter():
        if is_unlikely_node(node):
            logger.debug(
                "We should drop unlikely: %s %r", node.tag, node.attrib)
            should_remove.add(node)
        elif is_bad_link(node):
            logger.debug(
                "We should drop bad link: %s %r", node.tag, node.attrib)
            should_remove.add(node)
        elif node.tag in SCORABLE_TAGS:
            nodes_to_score.add(node)

    return score_candidates(nodes_to_score), should_remove
141553
function _searchIfRequired() {
        if (!FindUtils.isInstantSearchDisabled() && _findBar && _findBar._options.multifile && !_findBar._options.replace) {
            setTimeout(_defferedSearch, 100);
        }
    }