Return true if the operation name (i.e., "add", "mul", etc - not the user specified name) matches the specified regular expression
961453
public static OpPredicate opNameMatches(final String regex){
        return new OpPredicate() {
            @Override
            public boolean matches(SameDiff sameDiff, DifferentialFunction function) {
                return function.getOwnName().matches(regex);
            }
        };
    }
733654
def to_match(self):
        """"""
        self.validate()

        # The MATCH versions of some operators require an inverted order of arguments.
        # pylint: disable=unused-variable
        regular_operator_format = '(%(left)s %(operator)s %(right)s)'
        inverted_operator_format = '(%(right)s %(operator)s %(left)s)'  # noqa
        intersects_operator_format = '(%(operator)s(%(left)s, %(right)s).asList().size() > 0)'
        # pylint: enable=unused-variable

        # Null literals use 'is/is not' as (in)equality operators, while other values use '=/<>'.
        if any((isinstance(self.left, Literal) and self.left.value is None,
                isinstance(self.right, Literal) and self.right.value is None)):
            translation_table = {
                u'=': (u'IS', regular_operator_format),
                u'!=': (u'IS NOT', regular_operator_format),
            }
        else:
            translation_table = {
                u'=': (u'=', regular_operator_format),
                u'!=': (u'<>', regular_operator_format),
                u'>=': (u'>=', regular_operator_format),
                u'<=': (u'<=', regular_operator_format),
                u'>': (u'>', regular_operator_format),
                u'<': (u'<', regular_operator_format),
                u'+': (u'+', regular_operator_format),
                u'||': (u'OR', regular_operator_format),
                u'&&': (u'AND', regular_operator_format),
                u'contains': (u'CONTAINS', regular_operator_format),
                u'intersects': (u'intersect', intersects_operator_format),
                u'has_substring': (None, None),  # must be lowered into compatible form using LIKE

                # MATCH-specific operators
                u'LIKE': (u'LIKE', regular_operator_format),
                u'INSTANCEOF': (u'INSTANCEOF', regular_operator_format),
            }

        match_operator, format_spec = translation_table.get(self.operator, (None, None))
        if not match_operator:
            raise AssertionError(u'Unrecognized operator used: '
                                 u'{} {}'.format(self.operator, self))

        return format_spec % dict(operator=match_operator,
                                  left=self.left.to_match(),
                                  right=self.right.to_match())
624669
def match(self, other):
        
        if self.sub_type != '*' and other.sub_type != '*' and other.sub_type != self.sub_type:
            return False

        if self.main_type != '*' and other.main_type != '*' and other.main_type != self.main_type:
            return False

        return True
598845
def does_match_exist(self, inst):
        

        answer = True
        if self._decl_type is not None:
            answer &= isinstance(inst, self._decl_type)
        if self.name is not None:
            answer &= inst.name == self.name
        if self.parent is not None:
            answer &= self.parent is inst.parent
        if self.fullname is not None:
            if inst.name:
                answer &= self.fullname == declaration_utils.full_name(inst)
            else:
                answer = False
        return answer
1254772
def match_string(self, tokens, item):
        """"""
        prefix, name = tokens
        return self.match_mstring((prefix, name, None), item, use_bytes=prefix.startswith("b"))
342409
function matches( entry ){

        var len =       baseName.length;
        return entry[len] === "." && !entry.indexOf( baseName ) && entry.slice( len + 1 ).indexOf( "." ) === -1;
    }
1271809
def _match(self, regex):
        """"""
        cregex = re.compile(regex)
        for line in self.content.splitlines():
            match = cregex.match(line)
            if match:
                return match
        raise Exception('No "{0}" line in {1}.cpp'.format(
            regex_to_error_msg(regex),
            self.name
        ))
7252
function matchesCustom(ctx, opts) {
  if (opts.custom) {
    return opts.custom.call(ctx);
  }
  return false;
}
629084
private boolean matchModes(QName m1, QName m2)
  {
    return (((null == m1) && (null == m2))
            || ((null != m1) && (null != m2) && m1.equals(m2)));
  }
659203
def filter_service_by_regex_name(regex):
    
    host_re = re.compile(regex)

    def inner_filter(items):
        """Inner filter for service. Accept if regex match service_description"""
        service = items["service"]
        if service is None:
            return False
        return host_re.match(service.service_description) is not None

    return inner_filter
46873
def match(self, context, line):
		""""""
		stripped = line.stripped
		return stripped.startswith('#') and not stripped.startswith('#{')
724599
private boolean containsNumericMatcher(String matcherExpression) {
        for (String numericMatcher : numericMatchers) {
            if (matcherExpression.contains(numericMatcher)) {
                return true;
            }
        }

        return false;
    }
163899
def matches(property_name, regex, *, present_optional=False, message=None):
    """"""
    def check(val):
      """Checks that a value matches a scope-enclosed regex."""
      if not val:
        return present_optional
      else:
        return True if regex.search(val) else False

    return Validation(check, property_name, message)
90670
def file_match_any(self, filename):
        """"""
        if filename.startswith('.' + os.sep):
            filename = filename[len(os.sep) + 1:]
        if os.sep != '/':
            filename = filename.replace(os.sep, '/')

        for selector in self.file_selectors:
            if (selector.pattern.endswith('/') and
                    filename.startswith(selector.pattern)):
                return True
            if fnmatch.fnmatch(filename, selector.pattern):
                return True
        return False
500179
function isMatchRule(req, pathname, rule) {
  if (typeof rule === 'string') {
    return pathname.indexOf(rule) > -1;
  } else if (rule instanceof RegExp) {
    return rule.test(pathname);
  } else if (typeof rule === 'function') {
    return rule(pathname, req);
  }
}
133560
def _check_regex(minion_id, regex):
    '''
    
    '''
    get_pillar = False
    for pattern in regex:
        log.debug('nsot external pillar comparing %s with %s', minion_id, regex)
        match = re.search(pattern, minion_id)
        if match and match.string == minion_id:
            log.debug('nsot external pillar found a match!')
            get_pillar = True
            break
        log.debug('nsot external pillar unable to find a match!')
    return get_pillar
1311444
static boolean containsMatch(String actual, String regex) {
    return Pattern.compile(regex).matcher(actual).find();
  }