Return all matches and their distances, if they exceed the given threshold.
If no match exceeds the threshold this returns an empty list.
427683
public List<Match> matches(String desiredRaw, int threshold) {
    return matchesImpl(parse(desiredRaw), threshold);
  }
202878
def load_matches(self):
        
        if not self.exists():
            return []

        matches = []
        with open(self.location(), 'r') as f:
            for line in f.readlines():
                match_obj = json.loads(line.strip("\n"))
                if match_obj['processed']:
                    continue

                matches.append(match_obj)

        return matches
1291998
function getNumMatches(fileList, queryExpr) {
    var i,
        matches = 0;
    for (i = 0; i < fileList.length; i++) {
        var temp = countNumMatches(getFileContentsForFile(fileList[i]), queryExpr);
        if (temp) {
            numFiles++;
            matches += temp;
        }
        if (matches > MAX_TOTAL_RESULTS) {
            exceedsMaximum = true;
            break;
        }
    }
    return matches;
}
1245579
private boolean findMatches() throws IOException {
    // check for something in queue of matches
    if (!queueMatches.isEmpty()) {
      return true;
    } else {
      ignoreItem.advanceToDoc(spans.docID());
      while (true) {
        // try to get something in queue of spans
        if (queueSpans.isEmpty() && !collectSpan()) {
          return false;
        }
        // try to get matches with first span in queue
        Match firstMatch = queueSpans.remove(0);
        // create a list of matches with same startPosition as firstMatch
        List<Match> matches = new ArrayList<>();
        matches.add(firstMatch);
        // matches.addAll(expandWithIgnoreItem(spans.docID(), firstMatch));
        // try to collect spans until lastStartPosition not equal to
        // startPosition of firstMatch
        while (!lastSpan && (lastStartPosition == firstMatch.startPosition())) {
          collectSpan();
        }
        while (!queueSpans.isEmpty() && (queueSpans.get(0)
            .startPosition() == firstMatch.startPosition())) {
          Match additionalMatch = queueSpans.remove(0);
          matches.add(additionalMatch);
          matches.addAll(expandWithIgnoreItem(spans.docID(), additionalMatch));
        }
        // construct all matches for this startPosition
        for (Match match : matches) {
          for (int n = (minimumRecurrence - 1); n <= (maximumRecurrence
              - 1); n++) {
            findMatches(match, n);
          }
        }
        // check for something in queue of matches
        if (!queueMatches.isEmpty()) {
          ignoreItem.removeBefore(spans.docID(),
              queueMatches.get(0).startPosition());
          return true;
        }
      }
    }
  }
195777
private boolean checkMatch() {
        if (matchList == null) {
            return true;
        }
        final int matchSize = matchList.size();
        final int ancestorSize = topicIdList.size();
        final List<String> tail = topicIdList.subList(ancestorSize - matchSize, ancestorSize);
        return matchList.equals(tail);
    }
13311
public boolean hasBoundaryMatches()
    {
        for (Transition<DFAState<T>> t : transitions.values())
        {
            CharRange range = t.getCondition();
            if (range.getFrom() < 0)
            {
                return true;
            }
        }
        return false;
    }
941238
def FindMatchingPolys(self, start_point, end_point, max_radius=150):
    
    matches = []
    for shape in self._name_to_shape.itervalues():
      if start_point.GetDistanceMeters(shape.GetPoint(0)) < max_radius and \
        end_point.GetDistanceMeters(shape.GetPoint(-1)) < max_radius:
        matches.append(shape)
    return matches
636874
protected static List<Intervalable> findOverlappingRanges(IntervalNode node, Intervalable interval)
    {
        if (node != null)
        {
            return node.findOverlaps(interval);
        }
        return Collections.emptyList();
    }
950915
def find_matches(self, list_title):
        
        list_title_matches = []
        # Generate every possible tuple of titles and safe the matched string in a list.
        for a, b, in itertools.combinations(list_title, 2):
            if a == b:
                list_title_matches.append(a)

        return list_title_matches
995869
def matches(self, event):
        '''
        
        '''
        ret = []
        self._matches(event, set(), ret)
        return tuple(r[0] for r in ret)
1079458
def matchers() -> List[SimAlgorithm]:
        
        return [
            SimAlgorithm.PHENODIGM,
            SimAlgorithm.JACCARD,
            SimAlgorithm.SIM_GIC,
            SimAlgorithm.RESNIK,
            SimAlgorithm.SYMMETRIC_RESNIK
        ]
976394
@NotNull
  List<RuleMatch> getFilteredExtensionMatches(List<RuleMatch> matches, List<RemoteRuleMatch> extensionMatches) {
    List<RuleMatch> filteredExtMatches = new ArrayList<>();
    for (RemoteRuleMatch extensionMatch : extensionMatches) {
      if (!extensionMatch.isTouchedByOneOf(matches)) {
        AnalyzedSentence sentence = new AnalyzedSentence(new AnalyzedTokenReadings[]{});
        HiddenRule hiddenRule = new HiddenRule(extensionMatch.getLocQualityIssueType().orElse(null), extensionMatch.estimatedContextForSureMatch());
        RuleMatch hiddenRuleMatch = new RuleMatch(hiddenRule, sentence, extensionMatch.getErrorOffset(),
                extensionMatch.getErrorOffset()+extensionMatch.getErrorLength(), "(hidden message)");
        filteredExtMatches.add(hiddenRuleMatch);
      }
    }
    return filteredExtMatches;
  }
963638
def listEverything(matching=False):
    
    pages=pageNames()
    if matching:
        pages=[x for x in pages if matching in x]
    for i,page in enumerate(pages):
        pages[i]="%s%s (%s)"%(pageFolder(page),page,getPageType(page))
    print("\n".join(sorted(pages)))
1154557
def _check_normalization(self):
        
        lastDistance = None
        distance     = None
        for idx in xrange(len(self) - 1):
            distance = self[idx+1][0] - self[idx][0]

            # first run
            if lastDistance is None:
                lastDistance = distance
                continue

            if lastDistance != distance:
                return False

            lastDistance = distance

        return True
1337453
private Match matchImpl(List<Entry> desiredLocales, int threshold) {
    int bestDistance = MAX_DISTANCE;
    Entry bestMatch = null;
    for (Entry desired : desiredLocales) {
      List<String> exact = exactMatch.get(desired.locale);
      if (exact != null) {
        return new Match(exact.get(0), 0);
      }
      for (Entry supported : supportedLocales) {
        int distance = DISTANCE_TABLE.distance(desired.locale, supported.locale, threshold);
        if (distance < bestDistance) {
          bestDistance = distance;
          bestMatch = supported;
        }
      }
    }
    return bestMatch == null 
        ? new Match(firstEntry.bundleId, MAX_DISTANCE)
        : new Match(bestMatch.bundleId, bestDistance);
  }
1273465
def list(self, search_from=None, search_to=None, limit=None):
        
        l = []
        for i in self._list():
            l.append(i['data']['data'])
        return l[0:limit]
327884
private boolean matchCheck(int upperRange, int s, int prev, boolean interrupt) throws InterruptedException {
        if (Config.USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE) {
            if (Config.USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE) {
                //range = upperRange;
                if (matchAt(upperRange, s, prev, interrupt) != -1) {
                    if (!isFindLongest(regex.options)) return true;
                }
            } else {
                //range = upperRange;
                if (matchAt(upperRange, s, prev, interrupt) != -1) return true;
            }
        } else {
            if (Config.USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE) {
                if (matchAt(end, s, prev, interrupt) != -1) {
                    //range = upperRange;
                    if (!isFindLongest(regex.options)) return true;
                }
            } else {
                //range = upperRange;
                if (matchAt(end, s, prev, interrupt) != -1) return true;
            }
        }
        return false;
    }