Add label to FILTER if not set yet, removing ``PASS`` entry if
        present
172972
def add_filter(self, label):
        
        if label not in self.FILTER:
            if "PASS" in self.FILTER:
                self.FILTER = [f for f in self.FILTER if f != "PASS"]
            self.FILTER.append(label)
1136743
def addFilter(self, filter):
        
        self.FILTERS.append(filter)
        return "FILTER#{}".format(len(self.FILTERS) - 1)
736464
def add_filter(self, filter_or_string, *args, **kwargs):
        
        self.filters.append(build_filter(filter_or_string, *args, **kwargs))

        return self
40781
function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1)
	{
		if( is_callable($function_to_add) )
		{
			add_filter($tag, $function_to_add, $priority, $accepted_args);
		}
	}
107710
def add_preset(self, name, desc="", note=""):
        
        policy = self.policy
        if policy.find_preset(name):
            self.ui_log.error("A preset named '%s' already exists" % name)
            return False

        desc = desc or self.opts.desc
        note = note or self.opts.note

        try:
            policy.add_preset(name=name, desc=desc, note=note, opts=self.opts)
        except Exception as e:
            self.ui_log.error("Could not add preset: %s" % e)
            return False

        # Filter --add-preset <name> from arguments list
        arg_index = self._args.index("--add-preset")
        args = self._args[0:arg_index] + self._args[arg_index + 2:]

        self.ui_log.info("Added preset '%s' with options %s\n" %
                         (name, " ".join(args)))
        return True
710699
def Filter(self, match=None, **_):
    """"""
    arg = self.stack.pop(-1)

    # Filters can be specified as a comma separated list.
    for filter_name in match.group(1).split(","):
      filter_object = ConfigFilter.classes_by_name.get(filter_name)
      if filter_object is None:
        raise FilterError("Unknown filter function %r" % filter_name)

      if not filter_object.sensitive_arg:
        logging.debug("Applying filter %s for %s.", filter_name, arg)
      arg = filter_object().Filter(arg)
      precondition.AssertType(arg, Text)

    self.stack[-1] += arg
505798
def label(self, label, action='ADD', params=None):
        

        if params is None:
            params = {}

        if not label:
            self._tcex.handle_error(925, ['label', 'Security Label', 'label', 'label', label])

        if not self.can_update():
            self._tcex.handle_error(910, [self.type])

        if action == 'GET':
            return self.tc_requests.get_label(
                self.api_type,
                self.api_sub_type,
                self.unique_id,
                label,
                owner=self.owner,
                params=params,
            )

        if action == 'ADD':
            return self.tc_requests.add_label(
                self.api_type, self.api_sub_type, self.unique_id, label, owner=self.owner
            )

        if action == 'DELETE':
            return self.tc_requests.delete_label(
                self.api_type, self.api_sub_type, self.unique_id, label, owner=self.owner
            )

        self._tcex.handle_error(925, ['action', 'label', 'action', 'action', action])
        return None
1337044
def filter_host_by_bp_rule_label(label):
    

    def inner_filter(items):
        """Inner filter for host. Accept if label in host.labels"""
        host = items["host"]
        if host is None:
            return False
        return label in host.labels

    return inner_filter
1204406
def remove(self, label):
        
        if label.id in self._labels:
            self._labels[label.id] = None
        self._dirty = True
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;
    });
}
141404
def update(self, value=None, label=None):
        
        if label:
            self.label = label

        super(ProgressBar, self).update(value)
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)
}
1358675
def remove_from_labels(self, label):
        
        assert isinstance(label, (github.Label.Label, str, unicode)), label
        if isinstance(label, github.Label.Label):
            label = label._identity
        else:
            label = urllib.quote(label)
        headers, data = self._requester.requestJsonAndCheck(
            "DELETE",
            self.issue_url + "/labels/" + label
        )
532717
function (list, e, item) {
			this.options.todos.push(item);
			// Reset the filter so that you always see your new todo
			this.options.state.attr('filter', '');
		}
284829
def annotate_filter(**decargs):
    """"""
    def decorator(func):
        """Annotate events with entry and/or exit timestamps."""
        def wrapper(event, *args, **kwargs):
            """Add enter and exit annotations to the processed event."""
            funcname = ":".join([func.__module__, func.__name__])
            enter_key = funcname + "|enter"
            annotate_event(event, enter_key, **decargs)
            out = func(event, *args, **kwargs)
            exit_key = funcname + "|exit"
            annotate_event(event, exit_key, **decargs)
            return out

        return wrapper
    return decorator
73822
def search_in(label, string)
      raise(ArgumentError, "Unknown key: #{label}") unless LABELS.include?(label.to_sym)

      find_all do |entry|
        text = entry.send(label).str
        text.match(/#{string}/i)
      end
    end
424250
def _build_label_filter(category, *args, **kwargs):
    """"""
    terms = list(args)
    for key, value in six.iteritems(kwargs):
        if value is None:
            continue

        suffix = None
        if key.endswith(
            ("_prefix", "_suffix", "_greater", "_greaterequal", "_less", "_lessequal")
        ):
            key, suffix = key.rsplit("_", 1)

        if category == "resource" and key == "resource_type":
            key = "resource.type"
        else:
            key = ".".join((category, "label", key))

        if suffix == "prefix":
            term = '{key} = starts_with("{value}")'
        elif suffix == "suffix":
            term = '{key} = ends_with("{value}")'
        elif suffix == "greater":
            term = "{key} > {value}"
        elif suffix == "greaterequal":
            term = "{key} >= {value}"
        elif suffix == "less":
            term = "{key} < {value}"
        elif suffix == "lessequal":
            term = "{key} <= {value}"
        else:
            term = '{key} = "{value}"'

        terms.append(term.format(key=key, value=value))

    return " AND ".join(sorted(terms))