Returns True if given license field is correct
    Taken from rpmlint.

    It's named match() to mimic a compiled regexp.
179440
def match(license):
    ''''''
    if license not in VALID_LICENSES:
        for l1 in _split_license(license):
            if l1 in VALID_LICENSES:
                continue
            for l2 in _split_license(l1):
                if l2 not in VALID_LICENSES:
                    return False
                    valid_license = False
    return True
1334897
def rpm_compare(self, a, b):
        
        if a['version'] == b['version'] and \
           a['release'] == b['release'] and \
           a['signature'] == b['signature']:
            return

        raise ValueError("%s != %s" % (a, b))
1047165
def check_sig(package):
    
    rpmroot = '/'

    ts = rpm.TransactionSet(rpmroot)

    sigerror = 0
    ts.setVSFlags(0)
    hdr = return_hdr(ts, package)
    sigerror, (sigtype, sigdate, sigid) = get_sig_info(hdr)
    if sigid == 'None':
        keyid = 'None'
    else:
        keyid = sigid[-8:]
    if keyid != 'None':
        return True
    else:
        return False
1310489
def to_match(self):
        """"""
        self.validate()

        mark_name, field_name = self.location.get_location_name()
        validate_safe_string(mark_name)

        if field_name is None:
            return u'$matched.%s' % (mark_name,)
        else:
            validate_safe_string(field_name)
            return u'$matched.%s.%s' % (mark_name, field_name)
1305602
function matches_filter(filters, logicalPath, filename) {
  if (filters.length === 0) {
    return true;
  }

  return _.some(filters, function (filter) {
    if (_.isRegExp(filter)) {
      return filter.test(logicalPath);
    }

    if (_.isFunction(filter)) {
      return filter(logicalPath, filename);
    }

    // prepare string to become RegExp.
    // mimics shell's globbing
    filter = filter.toString().replace(/\*\*|\*|\?|\\.|\./g, function (m) {
      if (m[0] === '*') {
        return m === '**' ? '.+?' : '[^/]+?';
      }

      if (m[0] === '?') {
        return '[^/]?';
      }

      if (m[0] === '.') {
        return '\\.';
      }

      // handle `\\.` part
      return m;
    });

    // prepare RegExp
    filter = new RegExp('^' + filter + '$');
    return filter.test(logicalPath);
  });
}
1105258
def matchesTripleExprRef(cntxt: Context, T: RDFGraph, expr: ShExJ.tripleExprLabel, _: DebugContext) -> bool:
    
    expr = cntxt.tripleExprFor(expr)
    if expr is None:
        cntxt.fail_reason = "{expr}: Reference not found"
        return False
    return matchesExpr(cntxt, T, expr)
288288
def ref_string_matches_ref_sequence(self, ref_sequence):
        ''''''
        # you never know what you're gonna get...
        if self.POS < 0:
            return False

        end_pos = self.ref_end_pos()
        if end_pos >= len(ref_sequence):
            return False

        return self.REF == ref_sequence[self.POS:end_pos + 1]
7252
function matchesCustom(ctx, opts) {
  if (opts.custom) {
    return opts.custom.call(ctx);
  }
  return false;
}
275718
def ismatch(self, s):
        
        if self._ismatchfun(s) and self._compiled_pattern.match(s):
            return True
        return False
787422
def is_print(value, space = True, tab = False, crlf = False):
    
    if not isinstance(value, basestring):
        return False

    regex = r'\x00-\x08\x0B\x0C\x0E-\x1F\x7F'

    if not space:
        regex += r'\x20'

    if tab:
        regex += r'\x09'

    if crlf:
        regex += r'\x0A\x0D'

    return re.match(r'[' + regex + ']', value, re.U) is None
864110
def has_file_satisfied_by?(spec_file)
      file_paths.any? { |gem_file| RPM::Spec.file_satisfies?(spec_file, gem_file) }
    end
536471
def matches? meth
      Citero.map("").respond_to?(meth) && ( directionize(meth).eql?("to") || directionize(meth).eql?(meth.to_s) )
    end
131701
def is_system_rpm(self):
        """"""
        sys_rpm_paths = [
            '/usr/bin/rpm',
            # On CentOS6, system RPM is installed in this directory.
            '/bin/rpm',
        ]
        matched = False
        for sys_rpm_path in sys_rpm_paths:
            if self.rpm_path.startswith(sys_rpm_path):
                matched = True
                break
        return matched
495681
def check_match(self, name):
        
        return any(pattern.match(name) for pattern in self.patterns)
279840
def _match_real(filename, include, exclude, follow, symlinks):
    """"""

    sep = '\\' if util.platform() == "windows" else '/'
    if isinstance(filename, bytes):
        sep = os.fsencode(sep)
    if not filename.endswith(sep) and os.path.isdir(filename):
        filename += sep

    matched = False
    for pattern in include:
        if _fs_match(pattern, filename, sep, follow, symlinks):
            matched = True
            break

    if matched:
        matched = True
        if exclude:
            for pattern in exclude:
                if _fs_match(pattern, filename, sep, follow, symlinks):
                    matched = False
                    break
    return matched
1154411
def matches(self, regex, flags=0):
        
        return self._generate_test(
            lambda value: re.match(regex, value, flags),
            ('matches', self._path, regex)
        )
391804
def match(self, root, ns):
        
        tns = root.get('targetNamespace')
        if len(self.tns):
            matched = ( tns in self.tns )
        else:
            matched = 1
        itself = ( ns == tns )
        return ( matched and not itself )