/*
Filters out actions that do not match any pattern in the options.
330295
function filterActions(items) {
    let result = [];
    // We have to include only actions that include a render template. Ignore all others.
    items.forEach((actionObj) => {
      if (!actionObj.renderTemplates) return;  //no rendering
      let templates = actionObj.renderTemplates;
      // check if any error
      if (templates.error.length > 0 || templates.success || Object.keys(templates.all).length > 0) {
        result.push(actionObj);
      }
    });
    if (opt.actions == null) return result; // no filters.

    let filtered = [];
    // TODO: apply filter
    return filtered;
  }
880137
private List<Event> filterEvents(List<Event> events) {
        List<Event> filteredEvents = new ArrayList<Event>();
        for (Event event : events) {
            if (!filter(event)) {
                filteredEvents.add(event);
            }
        }
        return filteredEvents;
    }
837295
private void processFilterAction() {
		if (!(chkFilter.isSelected())) {
			applyFilters(new ArrayList<>());
		}
		if (chkFilter.isSelected()) {
			if (txtFilter.getText().isEmpty()) {
				chkFilter.setSelected(false);
				applyFilters(new ArrayList<>());
				return;
			}
			try {
				List<TreeModelFilter<SQLPPTriplesMap>> filters = parseSearchString(txtFilter.getText());
				if (filters == null) {
					throw new Exception("Impossible to parse search string");
				}
				applyFilters(filters);
			} catch (Exception e) {
				LoggerFactory.getLogger(this.getClass()).debug(e.getMessage(), e);
				JOptionPane.showMessageDialog(this, e.getMessage());
			}
		}
	}
515756
def filter_not_t(func):
    
    return Transformation('filter_not({0})'.format(name(func)),
                          partial(six.moves.filterfalse, func),
                          {ExecutionStrategies.PARALLEL})
1009721
function cleanupFilter(filter) {
  let filterToUse = filter;
  if (
    filterToUse.selectedFilter === "inList" &&
    typeof filterToUse.filterValue === "number"
  ) {
    filterToUse = {
      ...filterToUse,
      filterValue: filterToUse.filterValue.toString()
    };
  }
  if (filterToUse.selectedFilter === "inList") {
    filterToUse = {
      ...filterToUse,
      filterValue: filterToUse.filterValue.replace(/, |,/g, ".")
    };
  }
  return filterToUse;
}
1301661
@NotNull
    public OptionalLong filterNot(@NotNull LongPredicate predicate) {
        return filter(LongPredicate.Util.negate(predicate));
    }
561148
def filter_not_empty_values(value):
    """"""
    if not value:
        return None
    data = [x for x in value if x]
    if not data:
        return None
    return data
924569
private function filter_options() {
		$options = static::$options;

		// Remove checkbox options, only after background update complete.
		if ( ! $this->waiting_for_background_update() ) {
			$options = array_filter(
				$options,
				function ( $e ) {
					return '1' !== $e;
				}
			);
		}

		$options = array_merge( $options, $_POST['github_updater'] );

		return $options;
	}
187592
public void skip() {
        int we = wEnd;
        if (wOffset == we) { //requires special handling
            //if no variants at 'wOutside',advance pointer and clear
            if (top == null) {
                wOffset++;
                flush();
            }
            //otherwise, if there exist a variant,
            //don't clear(), i.e. allow it to match
            return;
        } else {
            if (we < 0) wOffset = 0;
            else wOffset = we;
        }
        //rflush(); //rflush() works faster on simple regexes (with a small group/branch number)
        flush();
    }
887785
function(options){
            var cleanOptions = this.parseOptions(options),
                excludes = _.clone(this.privateFields),
                includeExludes = [];

            // If any includes are passed in through the options clean up the
            // default excluded fields. A type can have some excluded fields by
            // default and if the user overrides this then we need to clean up the query.
            if(options && options.include){
                _.each(options.include, function(include){
                    //If the include matches an existing exclude then remove it from the
                    //excludes and also from the includes (you can't mix them)
                    excludes = _.remove(excludes, function(o){
                        if(o === include){
                            cleanOptions.include = _.remove(cleanOptions.include, function(i){
                                return i !== include;
                            });
                        }

                        return o !== include;
                    });

                });
            }

            includeExludes = _.union(cleanOptions.include,
                this.parseExclusion(cleanOptions.exclude),
                this.parseExclusion(excludes)
            );

            return includeExludes.join(' ');
        }
1066151
function cleanOptions(options) {
  if (options === undefined) {
    options = {
      selector: 'body'
    };
  } else if (typeof options === 'string') { // keeping compatiblity with version < v0.0.7
    if (options === '/') {
      options = {
        selector: 'body'
      };
    } else {
      options = {
        selector: options
      };
    }
  } else {
    options.selector = options.selector.replace('\\', '');
  }

  if (options.removeLinks === undefined) {
    options.removeLinks = false;
  }

  if (options.inlineCss === undefined) {
    options.inlineCss = true;
  }
  if (options.innerText === undefined) {
    options.innerText = false;
  }

  return options;
}
1042678
public function cleanupAction()
    {
        $params = $this->_processParameters($this->showParameters);
        $params['contentTitle'] = $this->_('Clean up existing appointments?');
        $params['filterOn']     = 'gap_id_procedure';
        $params['filterWhen']   = 'gap_filter';

        $snippets = array(
            'Generic\\ContentTitleSnippet',
            'Agenda\\AppointmentCleanupSnippet',
            'Agenda_CalendarTableSnippet',
            );

        $this->addSnippets($snippets, $params);
    }
628647
def filter_errors(errors, select=None, ignore=None, **params):
    
    select = select or []
    ignore = ignore or []

    for e in errors:
        for s in select:
            if e.number.startswith(s):
                yield e
                break
        else:
            for s in ignore:
                if e.number.startswith(s):
                    break
            else:
                yield e
744390
def _remove_action_from_type(valid_actions: Dict[str, List[str]],
                                 type_: str,
                                 filter_function: Callable[[str], bool]) -> None:
        
        action_list = valid_actions[type_]
        matching_action_index = [i for i, action in enumerate(action_list) if filter_function(action)]
        assert len(matching_action_index) == 1, "Filter function didn't find one action"
        action_list.pop(matching_action_index[0])
950759
function filter(fp, opts) {
  if (opts && opts.filter) {
    return opts.filter(fp, opts);
  }
  return /[^x]\.js$/.test(fp);
}
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)
}
1199183
def filter_ignoring_case(self, pattern):
        
        return self.filter(re.compile(pattern, re.I))