Filter options to distinguish between paratest
internal options and any other options.
198192
protected function filterOptions(array $options): array
    {
        $filtered = array_diff_key($options, [
            'processes' => $this->processes,
            'path' => $this->path,
            'phpunit' => $this->phpunit,
            'functional' => $this->functional,
            'stop-on-failure' => $this->stopOnFailure,
            'runner' => $this->runner,
            'no-test-tokens' => $this->noTestTokens,
            'colors' => $this->colors,
            'testsuite' => $this->testsuite,
            'max-batch-size' => $this->maxBatchSize,
            'filter' => $this->filter,
            'parallel-suite' => $this->parallelSuite,
            'passthru' => $this->passthru,
            'passthru-php' => $this->passthruPhp,
            'verbose' => $this->verbose,
        ]);
        if ($configuration = $this->getConfigurationPath($filtered)) {
            $filtered['configuration'] = new Configuration($configuration);
        }

        return $filtered;
    }
710072
def filter(self, table, idps, filter_string):
        """"""
        q = filter_string.lower()
        return [idp for idp in idps
                if q in idp.ud.lower()]
758024
def get_filter_options(cls):
        
        attr = '_filter_options_%s' % id(cls)

        options = getattr(cls, attr, {})
        if options:
            return options

        for key in dir(cls):
            val = getattr(cls, key)
            if isinstance(val, FilterOpt):
                options[key] = val

        setattr(cls, attr, options)
        return options
1328134
function getFilteredParamInfo(flapjack, options) {
    if (!flapjack) { return {}; }

    var aliases = this.getClientAliases(flapjack, options);
    var params = this.getParameters(flapjack) || [];
    params = params.filter(function (param) {
        return ['$scope', 'defaults', 'initialModel'].indexOf(param) < 0;
    });

    return this.getParamInfo(params, aliases) || {};
}
1300356
def options(self, parser, env=None):
        
        if env is None:
            env = os.environ
        env_opt_name = 'NOSE_%s' % self.__dest_opt_name.upper()
        parser.add_option("--%s" % self.__opt_name,
                          dest=self.__dest_opt_name,
                          type="string",
                          default=env.get(env_opt_name),
                          help=".ini file providing the environment for the "
                               "test web application.")
48432
function filterOptions(options, value)
{
	// If the input value is `undefined` or empty.
	if (!value) {
		return options
	}

	value = value.toLowerCase()

	return options.filter(({ label }) => label.toLowerCase().indexOf(value) >= 0)
}
888366
function combineFilterFirstValues(options) {
	return function(inSet, gt) {
		var values = inSet.values.filter(function(value) {
			return options.values.test(value, gt.value);
		});
		var range = options.with ? new options.with(gt.value) : gt;
		return values.length ?
			options.combinedUsing([new options.arePut(values), range]) : range;
	};
}
107927
private function applyFilters()
    {
        $availableOptions = ['name', 'method', 'uri', 'action', 'middleware'];
        foreach ($this->options() as $key => $option) {
            if (in_array($key, $availableOptions) && null != $option) {
                foreach ($this->routes as $index => $route) {
                    if (!str_contains(strtolower($route[$key]), strtolower($option)))
                        unset($this->routes[$index]);
                }
            }
        }
    }
63274
def parse_options(cls, options):
        """"""
        if (not options.putty_select and not options.putty_ignore and
                not options.putty_auto_ignore):
            return

        options._orig_select = options.select
        options._orig_ignore = options.ignore

        options.putty_select = Parser(options.putty_select)._rules
        options.putty_ignore = Parser(options.putty_ignore)._rules

        if options.putty_auto_ignore:
            options.putty_ignore.append(AutoLineDisableRule())

        options.ignore_code = functools.partial(
            putty_ignore_code,
            options,
        )

        options.report._ignore_code = options.ignore_code
612056
public boolean matchesFilter(String filter, int param) {

        filter = filter.toLowerCase();
        return m_parameters[param].toLowerCase().contains(filter);
    }
1244022
def Filter(self, filename_spec):
    """"""
    if "@" in filename_spec:
      file_path, package_name = filename_spec.split("@")
    else:
      file_path, package_name = filename_spec, Resource.default_package

    resource_path = package.ResourcePath(package_name, file_path)
    if resource_path is not None:
      return resource_path


    # pylint: disable=unreachable
    raise FilterError(
        "Unable to find resource %s while interpolating: " % filename_spec)
380858
function filterOptions(options, filter, substitutions) {
    // If the filter is blank, return the full list of Options.
    if (!filter) {
        return options;
    }

    var cleanFilter = cleanUpText(filter, substitutions);
    return options
    // Filter out undefined or null Options.
    .filter(function (_ref) {
        var label = _ref.label,
            value = _ref.value;
        return label != null && value != null;
    })
    // Create a {score, Option} pair for each Option based on its label's
    // similarity to the filter text.
    .map(function (option) {
        return {
            option: option,
            score: typeaheadSimilarity(cleanUpText(option.label, substitutions), cleanFilter)
        };
    })
    // Only include matches of the entire substring, with a slight
    // affordance for transposition or extra characters.
    .filter(function (pair) {
        return pair.score >= cleanFilter.length - 2;
    })
    // Sort 'em by order of their score.
    .sort(function (a, b) {
        return b.score - a.score;
    })
    // …and grab the original Options back from their pairs.
    .map(function (pair) {
        return pair.option;
    });
}
479481
def _ParseFilterOptions(self, options):
    
    names = ['artifact_filters', 'date_filters', 'filter_file']
    helpers_manager.ArgumentHelperManager.ParseOptions(
        options, self, names=names)

    extensions_string = self.ParseStringOption(options, 'extensions_string')
    self._ParseExtensionsString(extensions_string)

    names_string = getattr(options, 'names_string', None)
    self._ParseNamesString(names_string)

    signature_identifiers = getattr(options, 'signature_identifiers', None)
    try:
      self._ParseSignatureIdentifiers(
          self._data_location, signature_identifiers)
    except (IOError, ValueError) as exception:
      raise errors.BadConfigOption(exception)

    if self._artifact_filters or self._filter_file:
      self.has_filters = True
    else:
      self.has_filters = self._filter_collection.HasFilters()
1250456
def _has_exclusive_option(cls, options):
        """"""
        return any([getattr(options, opt) is not None for opt in
                    cls.BASE_ERROR_SELECTION_OPTIONS])
509493
def process_options(arglist=None):
    
    global options, args
    usage = "%prog [options] input ..."
    parser = OptionParser(usage)
    parser.add_option('-v', '--verbose', default=0, action='count',
                      help="print status messages, or debug with -vv")
    parser.add_option('-q', '--quiet', default=0, action='count',
                      help="report only file names, or nothing with -qq")
    parser.add_option('--exclude', metavar='patterns', default=default_exclude,
                      help="skip matches (default %s)" % default_exclude)
    parser.add_option('--filename', metavar='patterns',
                      help="only check matching files (e.g. *.py)")
    parser.add_option('--ignore', metavar='errors', default='',
                      help="skip errors and warnings (e.g. E4,W)")
    parser.add_option('--repeat', action='store_true',
                      help="show all occurrences of the same error")
    parser.add_option('--show-source', action='store_true',
                      help="show source code for each error")
    parser.add_option('--show-pep8', action='store_true',
                      help="show text of PEP 8 for each error")
    parser.add_option('--statistics', action='store_true',
                      help="count errors and warnings")
    parser.add_option('--benchmark', action='store_true',
                      help="measure processing speed")
    parser.add_option('--testsuite', metavar='dir',
                      help="run regression tests from dir")
    parser.add_option('--doctest', action='store_true',
                      help="run doctest on myself")
    options, args = parser.parse_args(arglist)
    if options.testsuite:
        args.append(options.testsuite)
    if len(args) == 0:
        parser.error('input not specified')
    options.prog = os.path.basename(sys.argv[0])
    options.exclude = options.exclude.split(',')
    for index in range(len(options.exclude)):
        options.exclude[index] = options.exclude[index].rstrip('/')
    if options.filename:
        options.filename = options.filename.split(',')
    if options.ignore:
        options.ignore = options.ignore.split(',')
    else:
        options.ignore = []
    options.counters = {}
    options.messages = {}

    return options, args
1300871
def options(cls):
        """"""
        return sorted((value, name) for (name, value) in cls.__dict__.items() if not name.startswith('__'))
1129497
def _filter_optional_keys(self, data):
        """"""
        for filter_key, filter_value in (self._optional_filters or {}).items():
            data_value = data.get(filter_key)
            LOG.debug(
                'optional keys filter %s: %s (%s)',
                filter_key, filter_value, data_value
            )
            if data_value is None or data_value != filter_value:
                LOG.debug(
                    'optional keys filter rejecting %s: %s (%s)',
                    filter_key, filter_value, data_value
                )
                return False
        return True