Matches an AST node that is static.
342661
public static <T extends Tree> Matcher<T> isStatic() {
    return new Matcher<T>() {
      @Override
      public boolean matches(Tree tree, VisitorState state) {
        Symbol sym = ASTHelpers.getSymbol(tree);
        return sym != null && sym.isStatic();
      }
    };
  }
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;
	}
590670
@Override
    public MatchType match(int level, Node node) {
        if(! (node instanceof Element)) {
            return MatchType.NOT_A_MATCH;
        }
        Element element = (Element) node;
        if(this.level != level) {
            return MatchType.NOT_A_MATCH;
        } else if(element.getName().equals(elementName) && element.hasAttribute(attributeName)
                && element.attributeValue(attributeName).equals(attributeValue)) {
            return MatchType.NODE_MATCH;
        }
        return MatchType.NOT_A_MATCH;
    }
127480
function isBindThis(node, currentNode) {
    return node.object === currentNode &&
        propertyIndicatesBind(node.property) &&
        node.parent.type === 'CallExpression' &&
        node.parent.callee === node;
}
1297453
function matches(elem, selector) {
  // Vendor-specific implementations of `Element.prototype.matches()`.
  var proto = window.Element.prototype;
  var nativeMatches = proto.matches ||
      proto.mozMatchesSelector ||
      proto.msMatchesSelector ||
      proto.oMatchesSelector ||
      proto.webkitMatchesSelector;

  if (!elem || elem.nodeType !== 1) {
    return false;
  }

  var parentElem = elem.parentNode;

  // use native 'matches'
  if (nativeMatches) {
    return nativeMatches.call(elem, selector);
  }

  // native support for `matches` is missing and a fallback is required
  var nodes = parentElem.querySelectorAll(selector);
  var len = nodes.length;

  for (var i = 0; i < len; i++) {
    if (nodes[i] === elem) {
      return true;
    }
  }

  return false;
}
746524
@SuppressWarnings("unchecked")
  private static Collection match(final OptionElement subroot,
                                  final String[] pathElements, int pos) {

    if (pos >= 0) {
      // Not at root.
      if (!pathElements[pos].equals(subroot.name)) {
        return null;
      }
    }

    if (subroot.isValue) {
      // pos must be last entry
      if ((pos + 1) != pathElements.length) {
        return null;
      }
      ArrayList res = new ArrayList();

      res.add(subroot.val);
      return res;
    }

    ArrayList res = new ArrayList();

    pos++;
    if (pos == pathElements.length) {
      /* return all the children of this level */

      for (OptionElement optel: subroot.getChildren()) {
        if (optel.isValue) {
          res.add(optel.val);
        }
      }

      return res;
    }

    for (OptionElement optel: subroot.getChildren()) {
      Collection subres = match(optel, pathElements, pos);
      if (subres != null) {
        res.addAll(subres);
      }
    }

    return res;
  }
630575
public static final <T extends Tree> Matcher<T> inSynchronized() {
    return new Matcher<T>() {
      @Override
      public boolean matches(T tree, VisitorState state) {
        SynchronizedTree synchronizedTree =
            ASTHelpers.findEnclosingNode(state.getPath(), SynchronizedTree.class);
        if (synchronizedTree != null) {
          return true;
        }

        MethodTree methodTree = ASTHelpers.findEnclosingNode(state.getPath(), MethodTree.class);
        return methodTree != null
            && methodTree.getModifiers().getFlags().contains(Modifier.SYNCHRONIZED);
      }
    };
  }
581419
public static Matcher<ExpressionTree> isInstanceField() {
    return new Matcher<ExpressionTree>() {
      @Override
      public boolean matches(ExpressionTree expressionTree, VisitorState state) {
        Symbol symbol = ASTHelpers.getSymbol(expressionTree);
        return symbol != null && symbol.getKind() == ElementKind.FIELD && !symbol.isStatic();
      }
    };
  }
951424
def _matches(o, pattern):
    """"""
    if not len(o) == len(pattern):
        return False
    comps = zip(o,pattern)
    return all(isinstance(obj,kind) for obj,kind in comps)
1360263
def _regex_to_static(src, regex):
    '''
    
    '''
    if not src or not regex:
        return None

    try:
        compiled = re.compile(regex, re.DOTALL)
        src = [line for line in src if compiled.search(line) or line.count(regex)]
    except Exception as ex:
        raise CommandExecutionError("{0}: '{1}'".format(_get_error_message(ex), regex))

    return src and src or []
361413
function (node, match) {
      do {
        if (!node || node.nodeName.toLowerCase() === match) {
          break
        }
        node = node.parentNode
      } while (node)

      return node
    }
633580
def match?(str, parser=nil)
      node = self.class.parse(str.to_s, parser) rescue (return false)
      self == node
    end
396665
def _bare_name_matches(self, nodes):
        """"""
        count = 0
        r = {}
        done = False
        max = len(nodes)
        while not done and count < max:
            done = True
            for leaf in self.content:
                if leaf[0].match(nodes[count], r):
                    count += 1
                    done = False
                    break
        r[self.name] = nodes[:count]
        return count, r
233712
static <K extends Comparable<K>> void checkNode(Node<K> node) {
        node.checkNode(null, null);
    }
795182
private static Matcher<Tree> shouldAllow(RestrictedApi api) {
    try {
      return Matchers.hasAnyAnnotation(api.whitelistAnnotations());
    } catch (MirroredTypesException e) {
      return Matchers.hasAnyAnnotation(e.getTypeMirrors());
    }
  }
939503
def match_division(node):
    
    """
    slash = token.SLASH
    return node.type == slash and not node.next_sibling.type == slash and \
                                  not node.prev_sibling.type == slash
357018
function match(node, type) {
            let innerStatementNode = node;

            while (innerStatementNode.type === "LabeledStatement") {
                innerStatementNode = innerStatementNode.body;
            }
            if (Array.isArray(type)) {
                return type.some(match.bind(null, innerStatementNode));
            }
            return StatementTypes[type].test(innerStatementNode, sourceCode);
        }