Check the completeness of the ring match
328049
def complete(self, match, subject_graph):
        """"""
        if not CustomPattern.complete(self, match, subject_graph):
            return False
        if self.strong:
            # If the ring is not strong, return False
            if self.size % 2 == 0:
                # even ring
                for i in range(self.size//2):
                    vertex1_start = match.forward[i]
                    vertex1_stop = match.forward[(i+self.size//2)%self.size]
                    paths = list(subject_graph.iter_shortest_paths(vertex1_start, vertex1_stop))
                    if len(paths) != 2:
                        #print "Even ring must have two paths between opposite vertices"
                        return False
                    for path in paths:
                        if len(path) != self.size//2+1:
                            #print "Paths between opposite vertices must half the size of the ring+1"
                            return False
            else:
                # odd ring
                for i in range(self.size//2+1):
                    vertex1_start = match.forward[i]
                    vertex1_stop = match.forward[(i+self.size//2)%self.size]
                    paths = list(subject_graph.iter_shortest_paths(vertex1_start, vertex1_stop))
                    if len(paths) > 1:
                        return False
                    if len(paths[0]) != self.size//2+1:
                        return False
                    vertex1_stop = match.forward[(i+self.size//2+1)%self.size]
                    paths = list(subject_graph.iter_shortest_paths(vertex1_start, vertex1_stop))
                    if len(paths) > 1:
                        return False
                    if len(paths[0]) != self.size//2+1:
                        return False
        return True
1275381
private boolean isPosTokenMatched(AnalyzedToken token) {
    if (posToken == null || posToken.posTag == null) {
      // if no POS set defaulting to true
      return true;
    }
    if (token.getPOSTag() == null) {
      return posToken.posUnknown && token.hasNoTag();
    }
    boolean match;
    if (posToken.regExp) {
      Matcher mPos = posToken.posPattern.matcher(token.getPOSTag());
      match = mPos.matches();
    } else {
      match = posToken.posTag.equals(token.getPOSTag());
    }
    if (!match && posToken.posUnknown) { // ignore helper tags
      match = token.hasNoTag();
    }
    return match;
  }
217683
function matches(node, query) {
  return (node.matches =
    node.matchesSelector ||
    node.mozMatchesSelector ||
    node.msMatchesSelector ||
    node.oMatchesSelector ||
    node.webkitMatchesSelector ||
    function(s) {
      const matches = (this.document || this.ownerDocument).querySelectorAll(s);
      let i = matches.length;
      while (--i >= 0 && matches.item(i) !== this) {}
      return i > -1;
    }).call(node, query);
}
1066204
public void checkAndMarkPlaced(IRingSet rs) {
        IRing ring = null;
        boolean allPlaced = true;
        boolean ringsetPlaced = true;
        for (int i = 0; i < rs.getAtomContainerCount(); i++) {
            ring = (IRing) rs.getAtomContainer(i);
            allPlaced = true;
            for (int j = 0; j < ring.getAtomCount(); j++) {
                if (!((IAtom) ring.getAtom(j)).getFlag(CDKConstants.ISPLACED)) {
                    allPlaced = false;
                    ringsetPlaced = false;
                    break;
                }
            }
            ring.setFlag(CDKConstants.ISPLACED, allPlaced);
        }
        rs.setFlag(CDKConstants.ISPLACED, ringsetPlaced);
    }
1270400
def _build_matches(matches, uuids, no_filtered, fastmode=False):
    """"""

    result = []

    for m in matches:
        mk = m[0].uuid if not fastmode else m[0]
        subset = [uuids[mk]]

        for id_ in m[1:]:
            uk = id_.uuid if not fastmode else id_
            u = uuids[uk]

            if u not in subset:
                subset.append(u)

        result.append(subset)

    result += no_filtered
    result.sort(key=len, reverse=True)

    sresult = []
    for r in result:
        r.sort(key=lambda id_: id_.uuid)
        sresult.append(r)

    return sresult
169060
def complete(self, text, state):
        
        if text != self.text:
            self.matches = self.completelist(text)
            self.text = text
        try:
            return self.matches[state]
        except IndexError:
            return None
761365
def _match_magic(self, full_path):
        """"""
        for magic in self.magics:
            if magic.matches(full_path):
                return magic
880515
function tagSetMatch(tagSet, serverTags) {
  const keys = Object.keys(tagSet);
  const serverTagKeys = Object.keys(serverTags);
  for (let i = 0; i < keys.length; ++i) {
    const key = keys[i];
    if (serverTagKeys.indexOf(key) === -1 || serverTags[key] !== tagSet[key]) {
      return false;
    }
  }

  return true;
}
519593
def _contains(self, hit):
        ''''''
        return (
            hit.qry_name not in self.contigs_to_keep
            and hit.qry_name != hit.ref_name
            and (100 * hit.hit_length_qry / hit.qry_length >= self.min_contig_percent_match)
            and hit.percent_identity >= self.nucmer_min_id
        )
754266
def match(self, p_todo):
        
        children = self.todolist.children(p_todo)
        uncompleted = [todo for todo in children if not todo.is_completed()]

        return not uncompleted
1181343
protected void checkConsecutiveAlpha() {

        Pattern symbolsPatter = Pattern.compile(REGEX_ALPHA_UC + "+");
        Matcher matcher = symbolsPatter.matcher(this.password);
        int met = 0;
        while (matcher.find()) {
            int start = matcher.start();
            int end = matcher.end();
            if (start == end) {
                continue;
            }
            int diff = end - start;
            if (diff >= 3) {
                met += diff;
            }

        }

        this.result.negative(met * CONSECUTIVE_ALPHA_WEIGHT);

        // alpha lower case

        symbolsPatter = Pattern.compile(REGEX_ALPHA_LC + "+");
        matcher = symbolsPatter.matcher(this.password);
        met = 0;
        while (matcher.find()) {
            int start = matcher.start();
            int end = matcher.end();
            if (start == end) {
                continue;
            }
            int diff = end - start;
            if (diff >= 3) {
                met += diff;
            }

        }

        this.result.negative(met * CONSECUTIVE_ALPHA_WEIGHT);
    }
145798
private Long tokenMatch(SNode tok) {
		// check if the span is a matched node
		SFeature featMatched = tok.getFeature(ANNIS_NS, FEAT_MATCHEDNODE);
		Long matchRaw = featMatched == null ? null : featMatched.getValue_SNUMERIC();
		return matchRaw;
	}
1062933
def selector_matches?(selector)
      selector.any? do |group|
        group.keys.all? do |key|
          input_has_key?(key) && (@input[key] == group[key] || group[key].nil?)
        end
      end
    end
1217854
function checkElementHitting(box1, box2) {
                    return (box2.beginX <= box1.beginX && box1.beginX <= box2.endX || box1.beginX <= box2.beginX && box2.beginX <= box1.endX) &&
                        (box2.beginY <= box1.beginY && box1.beginY <= box2.endY || box1.beginY <= box2.beginY && box2.beginY <= box1.endY);
                }
217335
function matches(node, sl) {
    if (!node || node.nodeType !== 1) return false;
    var datas = parse(sl),
      len = datas.length;
    if (!datas[len - 1][0]) return false;
    for (; len--;) {
      if (matchOneData(node, datas[len])) return true;
    }
    return false;
  }
857515
def complete(self):
        """"""
        if None not in [v for v in self.squares]:
            return True
        if self.winner() is not None:
            return True
        return False
269160
function (parts) {
        var result,
            context = {
                parts: parts,
                startPos: 0
            };
        result = this._matchStart(context) || this._matchEnd(context);
        return result !== _GPF_PATHMATCH_KO;
    }