Matches `&&` and `||` operators.
486927
function isBooleanBinaryExpression(node) {
    return node.kind === ts.SyntaxKind.BinaryExpression && binaryBooleanExpressionKind(node) !== undefined;
}
316683
function matches(str, match) {
    if (Array.isArray(match)) return match.indexOf(str) > -1;
    return match.test(str);
}
1037898
@Override
    public boolean matches(IAtom atom) {
        boolean val = false;
        boolean matchesLeft = left.matches(atom);
        if (right != null) {
            if ("and".equals(operator) && matchesLeft) {
                boolean matchesRight = right.matches(atom);
                val = matchesLeft && matchesRight;
            } else if ("or".equals(operator)) {
                boolean matchesRight = right.matches(atom);
                val = matchesLeft || matchesRight;
            }
        } else {
            if ("not".equals(operator)) {
                val = (!matchesLeft);
            } else {
                val = matchesLeft;
            }
        }
        return val;
    }
797334
def match(self, chars):
        """"""
        start_index = self.next_index
        for char in self:
            if char not in chars:
                self.next_index -= 1
                break
        return self[start_index:self.next_index]
915229
def logical_and(self, other):
        """"""
        return self.operation(other, lambda x, y: int(x and y))
290728
def match_all_in(self, matches, item):
        """"""
        for i, match in enumerate(matches):
            self.match(match, item + "[" + str(i) + "]")
35435
private boolean matchClause(Clause clause, char[] chars, int[] cursor) {
    if (clause.minlen > cursor[1] - cursor[0])
      return false;
    for (int i = 0; i < clause.items.length; i++) {
      Object item = clause.items[i];
      if (item == matchOne)
        cursor[0]++;
      else if (!matchForward(chars, (char[]) item, cursor))
        return false;
      // else this phase succeeded so continue
    }
    return true;
  }
45058
def _match_literal(self, a, b=None):
        """"""

        return a.lower() == b if not self.case_sensitive else a == b
876790
function match(input, patterns = []){
	if(!patterns || 0 === patterns.length)
		return false;
	
	input    = String(input);
	patterns = arrayify(patterns).filter(Boolean);
	for(const pattern of patterns)
		if((pattern === input && "string" === typeof pattern)
		|| (pattern instanceof RegExp) && pattern.test(input))
			return true;
	return false;
}
713856
function boolMatch(s, matchers) {
    var i, matcher, down = s.toLowerCase();
    matchers = [].concat(matchers);
    for (i = 0; i < matchers.length; i += 1) {
      matcher = matchers[i];
      if (!matcher) continue;
      if (matcher.test && matcher.test(s)) return true;
      if (matcher.toLowerCase() === down) return true;
    }
  }
566042
def matches?(string, what)
      Regexp === what ? string.strip =~ what : string == what.to_s
    end
1143828
def ismatch(a,b):
    """"""
    #Try the easy case
    if a == b:
        return True
    else:
        #Try isinstance in both orders
        try:
            if isinstance(a,b):
                return True
        except TypeError:
            try:
                if isinstance(b,a):
                    return True
            except TypeError:
                #Try isinstance(a, type(b)) in both orders
                try:
                    if isinstance(a,type(b)):
                        return True
                except TypeError:
                    try:
                        if isinstance(b,type(a)):
                            return True
                    except TypeError:
                        #Try the string representation
                        if str(a).lower() == str(b).lower():
                            return True
                        else:
                            return False
309692
def match(self, s=''):
        
        match = s.lower()
        res = {}
        for k in sorted(self):
            s = str(k) + '=\'' + str(self[k]) + '\''
            if match in s.lower():
                res[k] = self[k]
        return CMAOptions(res, unchecked=True)
259812
def and_(cls, obj, **kwargs):
        
        return cls.__eval_seqexp(obj, operator.and_, **kwargs)
888234
private boolean datatypeMatches(Datatype d1, Datatype d2) {
        assert (d1.getFeature() == d2.getFeature());

        AbstractLiteral lhsLit = d1.getLiteral();
        AbstractLiteral rhsLit = d2.getLiteral();

        Operator lhsOp = d1.getOperator();
        Operator rhsOp = d2.getOperator();

        if (rhsOp == Operator.EQUALS) {
            // If the rhs operator is =, then the expression will only match
            // if the lhs operator is also = and the literal values are the
            // same.
            if(lhsOp != Operator.EQUALS) {
                return false;
            } else {
                return d1.getLiteral().equals(d2.getLiteral());
            }
        } else if (rhsOp == Operator.GREATER_THAN) {
            if (lhsOp == Operator.LESS_THAN
                    || lhsOp == Operator.LESS_THAN_EQUALS) {
                return false;
            } else if (lhsOp == Operator.EQUALS) {
                if (compareLiterals(lhsLit, rhsLit) > 0) {
                    return true;
                } else {
                    return false;
                }
            } else if (lhsOp == Operator.GREATER_THAN) {
                if (compareLiterals(lhsLit, rhsLit) >= 0) {
                    return true;
                } else {
                    return false;
                }
            } else if (lhsOp == Operator.GREATER_THAN_EQUALS) {
                if (compareLiterals(lhsLit, rhsLit) > 0) {
                    return true;
                } else {
                    return false;
                }
            }
        } else if (rhsOp == Operator.GREATER_THAN_EQUALS) {
            if (lhsOp == Operator.LESS_THAN
                    || lhsOp == Operator.LESS_THAN_EQUALS) {
                return false;
            } else if (lhsOp == Operator.EQUALS) {
                if (compareLiterals(lhsLit, rhsLit) >= 0) {
                    return true;
                } else {
                    return false;
                }
            } else if (lhsOp == Operator.GREATER_THAN) {
                if (compareLiterals(lhsLit, rhsLit) >= -1) {
                    return true;
                } else {
                    return false;
                }
            } else if (lhsOp == Operator.GREATER_THAN_EQUALS) {
                if (compareLiterals(lhsLit, rhsLit) >= 0) {
                    return true;
                } else {
                    return false;
                }
            }
        } else if (rhsOp == Operator.LESS_THAN) {
            if (lhsOp == Operator.GREATER_THAN
                    || lhsOp == Operator.GREATER_THAN_EQUALS) {
                return false;
            } else if (lhsOp == Operator.EQUALS) {
                if (compareLiterals(lhsLit, rhsLit) < 0) {
                    return true;
                } else {
                    return false;
                }
            } else if (lhsOp == Operator.LESS_THAN) {
                if (compareLiterals(lhsLit, rhsLit) <= 0) {
                    return true;
                } else {
                    return false;
                }
            } else if (lhsOp == Operator.LESS_THAN_EQUALS) {
                if (compareLiterals(lhsLit, rhsLit) < 0) {
                    return true;
                } else {
                    return false;
                }
            }
        } else if (rhsOp == Operator.LESS_THAN_EQUALS) {
            if (lhsOp == Operator.GREATER_THAN
                    || lhsOp == Operator.GREATER_THAN_EQUALS) {
                return false;
            } else if (lhsOp == Operator.EQUALS) {
                if (compareLiterals(lhsLit, rhsLit) <= 0) {
                    return true;
                } else {
                    return false;
                }
            } else if (lhsOp == Operator.LESS_THAN) {
                if (compareLiterals(lhsLit, rhsLit) <= 1) {
                    return true;
                } else {
                    return false;
                }
            } else if (lhsOp == Operator.LESS_THAN_EQUALS) {
                if (compareLiterals(lhsLit, rhsLit) <= 0) {
                    return true;
                } else {
                    return false;
                }
            }
        }

        return d1.getLiteral().equals(d2.getLiteral());
    }
611149
function __match(regexp) {
  return function(ch) { 
  	return !!(ch !== DONE && (ch === undefined || ch.match(regexp)))? MATCH_TRUE: MATCH_FALSE };
}
992209
def _escape_regexp(s):
    """"""
    return (
        str(s)
        .replace('|', '\\|')
        .replace('.', '\.')  # `.` has to be replaced before `*`
        .replace('*', '.*')
        .replace('+', '\+')
        .replace('(', '\(')
        .replace(')', '\)')
        .replace('$', '\\$')
    )