Return if a specific option for a pattern is set
@param  {String}     the pattern to check
@param  {String}     the option to check
556925
public static function checkPatternOption($patternStoreKey,$optionName) {

		if (isset(self::$store[$patternStoreKey])) {
			return isset(self::$store[$patternStoreKey][$optionName]);
		}

		return false;

	}
1038225
def check_config_mode(self, check_string=">config", pattern=""):
        
        return super(RadETXBase, self).check_config_mode(
            check_string=check_string, pattern=pattern
        )
1098653
public static boolean isValidPattern(String pattern) {
    if (pattern == null) {
      return false;
    }
    String canon = pattern.replace('/', '.');
    return ClassName.isQualifiedName(canon)
        || ClassName.isStarQualifiedName(canon);
  }
1017237
function opt(pattern, defval) {
        return new Pattern(pattern + '?', function (str, pos) {
            return pattern.exec(str, pos) || { res: defval, end: pos };
        });
    }
656322
public boolean checkRegexPattern(final Optional<Subject> subjectOption,
                                     final Optional<Pattern> patternOption)
    {
        final boolean[] roleOk = {false};
        subjectOption.ifPresent(subject -> patternOption.ifPresent(pattern -> {
            final List<? extends Permission> permissions = subject.getPermissions();
            if (permissions != null)
            {
                for (Iterator<? extends Permission> iterator = permissions.iterator(); !roleOk[0] && iterator.hasNext(); )
                {
                    final Permission permission = iterator.next();
                    roleOk[0] = pattern.matcher(permission.getValue()).matches();
                }
            }
        }));

        return roleOk[0];
    }
791025
function (pattern) {
            var
                parser = new PatternParser();
            parser.parse(pattern, null);
            this._patternItem = parser.patternItem();
        }
576239
function (item, arr, options) {

            debug('Match');
            debug('Item: %s', item);
            debug('Array: %s', arr);
            debug('Options: %o', options);

            // normal item match (case-sensitive)
            let found = arr.indexOf(item) > -1;

            // case insensitive test if only item not found in case-sensitive mode
            if (options.caseInsensitive || (options.caseInsensitive && !found)) {

                debug('Checking case-insensitive too...');

                arr.map(target => {

                    if (target.toLowerCase() === item.toLowerCase()) {

                        found = true;
                    }
                });
            }

            debug('Found: %s', found);

            return found;
        }
294604
function checkOptions(opts1, opts2) {
        for (var prop in opts1) {
            if (opts1.hasOwnProperty(prop)) {
                if (opts1[prop] !== opts2[prop]) {
                    return true;
                }
            }
        }
        return false;
    }
143604
public boolean isLintSet(String s) {
        // return true if either the specific option is enabled, or
        // they are all enabled without the specific one being
        // disabled
        return
            isSet(XLINT_CUSTOM, s) ||
            (isSet(XLINT) || isSet(XLINT_CUSTOM, "all")) && isUnset(XLINT_CUSTOM, "-" + s);
    }
1229864
public static boolean safeRegexMatch(String pattern, String value) {
        if (StringUtils.isNotBlank(pattern)) {
            if (value == null) {
                return false;
            } else {
                try {
                    return Pattern.matches(pattern, value);
                } catch (PatternSyntaxException ex) {
                    return false;
                }
            }
        } else {
            return false;
        }
    }
529455
private static function isFileNamePatternMatch($name, $pattern, $options) {
    if (in_array($name, static::$excluded_file_names)) {
      return false;
    }

    $fnmatch_flags = 0;
    if ($options & GLOB_NOESCAPE) {
      $fnmatch_flags |= FNM_NOESCAPE;
    }

    return fnmatch($pattern, $name, $fnmatch_flags);
  }
527885
def validateExtractOptions(options):
    ''' '''

    if not options.pattern and not options.pattern2:
        if not options.read2_in:
            U.error("Must supply --bc-pattern for single-end")
        else:
            U.error("Must supply --bc-pattern and/or --bc-pattern2 "
                    "if paired-end ")

    if options.pattern2:
        if not options.read2_in:
            U.error("must specify a paired fastq ``--read2-in``")

        if not options.pattern2:
            options.pattern2 = options.pattern

    extract_cell = False
    extract_umi = False

    # If the pattern is a regex we can compile the regex(es) prior to
    # ExtractFilterAndUpdate instantiation
    if options.extract_method == "regex":
        if options.pattern:
            try:
                options.pattern = regex.compile(options.pattern)
            except regex.error:
                U.error("--bc-pattern '%s' is not a "
                        "valid regex" % options.pattern)

        if options.pattern2:
            try:
                options.pattern2 = regex.compile(options.pattern2)
            except regex.Error:
                U.error("--bc-pattern2 '%s' is not a "
                        "valid regex" % options.pattern2)

    # check whether the regex contains a umi group(s) and cell groups(s)
    if options.extract_method == "regex":
        if options.pattern:
            for group in options.pattern.groupindex:
                if group.startswith("cell_"):
                    extract_cell = True
                elif group.startswith("umi_"):
                    extract_umi = True
        if options.pattern2:
            for group in options.pattern2.groupindex:
                if group.startswith("cell_"):
                    extract_cell = True
                elif group.startswith("umi_"):
                    extract_umi = True

    # check whether the pattern string contains umi/cell bases
    elif options.extract_method == "string":
        if options.pattern:
            if "C" in options.pattern:
                extract_cell = True
            if "N" in options.pattern:
                extract_umi = True
        if options.pattern2:
            if "C" in options.pattern2:
                extract_cell = True
            if "N" in options.pattern2:
                extract_umi = True

    if not extract_umi:
        if options.extract_method == "string":
            U.error("barcode pattern(s) do not include any umi bases "
                    "(marked with 'Ns') %s, %s" % (
                        options.pattern, options.pattern2))
        elif options.extract_method == "regex":
            U.error("barcode regex(es) do not include any umi groups "
                    "(starting with 'umi_') %s, %s" (
                        options.pattern, options.pattern2))

    return(extract_cell, extract_umi)
520494
function isSelectionInList(
    opts: Options,
    value: Value,
    type?: string
): boolean {
    const items = getItemsAtRange(opts, value);
    return (
        !items.isEmpty() &&
        // Check the type of the list if needed
        (!type ||
            getListForItem(opts, value, items.first()).get('type') === type)
    );
}
958794
public boolean isPatterned() {

        final boolean result;
        if (pattern.indexOf('*') != -1 || pattern.indexOf('?') != -1) {
            result = true;
        } else {
            result = false;
        }

        return result;
    }
822748
def visit_Set(self, pattern):
        
        if len(pattern.elts) > MAX_UNORDERED_LENGTH:
            raise DamnTooLongPattern("Pattern for Set is too long")
        return (isinstance(self.node, Set) and
                any(self.check_list(self.node.elts, pattern_elts)
                    for pattern_elts in permutations(pattern.elts)))
1260769
public boolean find(Pattern pattern)
    {
        matcher.usePattern(pattern);
        int start = matcher.regionStart();
        if (matcher.find())
        {
            stack.add(new MatchResultImpl(matcher));
            matcher.region(matcher.end(), matcher.regionEnd());
            return true;
        }
        else
        {
            return false;
        }
    }
66811
public void setPattern(String pattern) {
        if (pattern == null || pattern.length() <= 0) {
            throw new IllegalArgumentException(
                    "Pattern to search for can not be null or of length 0");
        }
        pattern_.text_ = pattern;
        initialize();
    }