--------------------------- CUSTOM DUST FILTERS ---------------------------
341070
function dotProp(name, forSidebar) {
        var re = /(.*)([.#~][\w:]+)/g,
            match = re.exec(name);
        if (!match) return '<span class="fw-bold">' + name + '</span>';
        if (forSidebar) {
            var cls = templateOpts.sidebar.animations ? ' trans-all-ease-fast' : '';
            return '<span class="color-gray symbol-memberof' + cls + '">' + app.helper.colorOperators(match[1]) + '</span><span>' + app.helper.colorOperators(match[2]) + '</span>';
        }
        return '<span class="color-gray">' + app.helper.colorOperators(match[1]) + '</span><span class="fw-bold">' + app.helper.colorOperators(match[2]) + '</span>';
    }
538933
public void setFilters(String filters)
    {
        for (String filter : filters.split(",")) {
            filteredFrames.add("at " + filter.trim());
        }
    }
699768
function _createFilter(res) {
    for (var i = 0; i < res.length; ++i) {
      var f = res[i]

      if (f instanceof RegExp)
        custfilt.push(f)
      else {
        //console.log('--- creating regex with `' + str + '`')
        try {
          f = new RegExp(f)
          custfilt.push(f)
        }
        catch (e) {
          f = null
        }
        if (!f) this.invalid('custom filter', res[i])
      }
    }
  }
1216381
public void addFilter(final ItemFilter filter) {
        if (filters == null) {
            filters = new ArrayList<ItemFilter>();
        }

        filters.add(filter);
    }
662317
public function onFilterUpdate()
    {
        $this->defineFilterScopes();

        if (!$scope = post('scopeName')) {
            return;
        }

        $scope = $this->getScope($scope);

        switch ($scope->type) {
            case 'group':
                $active = $this->optionsFromAjax(post('options.active'));
                $this->setScopeValue($scope, $active);
                break;

            case 'checkbox':
                $checked = post('value') == 'true';
                $this->setScopeValue($scope, $checked);
                break;

            case 'switch':
                $value = post('value');
                $this->setScopeValue($scope, $value);
                break;

            case 'date':
                $dates = $this->datesFromAjax(post('options.dates'));

                if (!empty($dates)) {
                    list($date) = $dates;
                }
                else {
                    $date = null;
                }

                $this->setScopeValue($scope, $date);
                break;

            case 'daterange':
                $dates = $this->datesFromAjax(post('options.dates'));

                if (!empty($dates)) {
                    list($after, $before) = $dates;

                    $dates = [$after, $before];
                }
                else {
                    $dates = null;
                }

                $this->setScopeValue($scope, $dates);
                break;

            case 'number':
                $numbers = $this->numbersFromAjax(post('options.numbers'));

                if (!empty($numbers)) {
                    list($number) = $numbers;
                }
                else {
                    $number = null;
                }

                $this->setScopeValue($scope, $number);
                break;

            case 'numberrange':
                $numbers = $this->numbersFromAjax(post('options.numbers'));

                if (!empty($numbers)) {
                    list($min, $max) = $numbers;

                    $numbers = [$min, $max];
                }
                else {
                    $numbers = null;
                }

                $this->setScopeValue($scope, $numbers);
                break;

            case 'text':
                $values = post('options.value');

                if ($values !== null && $values !== '') {
                    list($value) = $values;
                }
                else {
                    $value = null;
                }

                $this->setScopeValue($scope, $value);
                break;
        }

        /*
         * Trigger class event, merge results as viewable array
         */
        $params = func_get_args();

        $result = $this->fireEvent('filter.update', [$params]);

        if ($result && is_array($result)) {
            return call_user_func_array('array_merge', $result);
        }
    }
34473
public function renderFilters()
    {
        foreach ($this->filters->getFilters() as $filter) {
            // if the current filter is a "hidden filter", skip
            // rendering of this filter. The filter is only used
            // to add preselected filter options to the query and
            // must not be rendered.
            $isInList = GeneralUtility::inList($this->conf['hiddenfilters'], $filter['uid']);

            if ($isInList) {
                continue;
            }

            // get filter options which should be displayed
            $options = $this->findFilterOptionsToDisplay($filter);

            // alphabetical sorting of filter options
            if ($filter['alphabeticalsorting'] == 1) {
                $this->sortArrayByColumn($options, 'title');
            }

            // hook for modifying filter options
            if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilterOptionsArray'])) {
                foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['modifyFilterOptionsArray'] as
                         $_classRef) {
                    $_procObj = &GeneralUtility::makeInstance($_classRef);
                    $options = $_procObj->modifyFilterOptionsArray($filter['uid'], $options, $this);
                }
            }

            // build link to reset this filter while keeping the others
            unset($linkconf);
            $linkconf['parameter'] = $GLOBALS['TSFE']->id;
            $linkconf['additionalParams'] = '&tx_kesearch_pi1[sword]=' . $this->piVars['sword'];
            $linkconf['additionalParams'] .= '&tx_kesearch_pi1[filter][' . $filter['uid'] . ']=';
            if (is_array($this->piVars['filter']) && count($this->piVars['filter'])) {
                foreach ($this->piVars['filter'] as $key => $value) {
                    if ($key != $filter['uid']) {
                        $linkconf['additionalParams'] .= '&tx_kesearch_pi1[filter][' . $key . ']=' . $value;
                    }
                }
            }
            $resetLink = $this->cObj->typoLink_URL($linkconf);

            // set values for fluid template
            $filterData = $filter;
            $filterData['name'] = 'tx_kesearch_pi1[filter][' . $filter['uid'] . ']';
            $filterData['id'] = 'filter_' . $filter['uid'];
            $filterData['options'] = $options;
            $filterData['checkboxOptions'] = $this->compileCheckboxOptions($filter, $options);
            $filterData['optionCount'] = is_array($options) ? count($options) : 0;
            $filterData['resetLink'] = $resetLink;

            // special classes / custom code
            switch ($filter['rendertype']) {
                case 'textlinks':
                    $textLinkObj = GeneralUtility::makeInstance(Textlinks::class, $this);
                    $textLinkObj->renderTextlinks($filter['uid'], $options, $this);
                    break;

                // use custom code for filter rendering
                // set $filterData['rendertype'] = 'custom'
                // and $filterData['rawHtmlContent'] to your pre-rendered filter code
                default:
                    // hook for custom filter renderer
                    if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['customFilterRenderer'])) {
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['customFilterRenderer'] as
                                 $_classRef) {
                            $_procObj = &GeneralUtility::makeInstance($_classRef);
                            $_procObj->customFilterRenderer($filter['uid'], $options, $this, $filterData);
                        }
                    }
                    break;
            }

            // add values to fluid template
            $this->fluidTemplateVariables['filters'][] = $filterData;
        }
    }
558049
protected function addColumnFilters()
    {
        foreach ($this->columns as $i => $column) {
            if (static::$versionTransformer->isColumnSearched($i)) {
                $this->builder->where(
                    new raw($this->getRawColumnQuery($column)),
                    'like',
                    '%' . static::$versionTransformer->getColumnSearchValue($i) . '%'
                );
            }
        }
    }
222685
public function initFilters()
    {

        //Only run on frontend
        if (is_admin()) {
            return;
        }

        global $wp_query;

        if ((is_category() || is_tax() || is_tag()) && !get_post_type()) {
            $postType = 'post';
        }

        $postType = get_post_type();

        if (!$postType && isset($wp_query->query['post_type'])) {
            $postType = $wp_query->query['post_type'];
        }

        if (!$postType) {
            return;
        }

        $queriedObject = get_queried_object();
        $objectId = null;
        if (isset($queriedObject->ID)) {
            $objectId = $queriedObject->ID;
        }

        $pageForPosts = get_option('page_for_' . get_post_type());

        if (($pageForPosts !== $objectId && !is_archive() && !is_post_type_archive() && !is_home() && !is_category() && !is_tax() && !is_tag()) || is_admin()) {
            return;
        }

        add_action('Municipio/viewData', function ($data) use ($wp_query, $postType) {

            //Get current post type enabledTaxonomyFilters
            if (!isset($data['postType']) || !$data['postType']) {
                $data['postType'] = $postType;
            }

            //Get header filters
            if ($enabledHeaderFilters = get_field('archive_' . $data['postType'] . '_post_filters_header', 'option')) {
                $data['enabledHeaderFilters'] = $enabledHeaderFilters;
            } else {
                $data['enabledHeaderFilters'] = array();
            }

            //Get taxonomy filters
            if ($enabledTaxonomyFilters = $this->getEnabledTaxonomies($data['postType'])) {
                $data['enabledTaxonomyFilters'] = $enabledTaxonomyFilters;
            } else {
                $data['enabledTaxonomyFilters'] = array();
            }

            //Is query string present?
            $data['queryString'] = (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) ? true : false;

            //The archive url
            $data['archiveUrl'] = $this->getArchiveSlug($postType);

            $data['searchQuery'] = $this->getSearchQuery();

            return $data;
        });
    }
853298
def set_filters(self, can_filers=None):
        
        if self.__set_filters_has_been_called:
            logger.warn("using filters is not supported like this, see note on NicanBus")
        else:
            # allow the constructor to call this without causing a warning
            self.__set_filters_has_been_called = True
139860
function() {

			// covert the values array into an array of filter objects
			var aFilters = [];
			for (var i = 0, l = this.aValues && this.aValues.length || 0; i < l; i++) {
				aFilters.push(new Filter({
					path: this.sPath,
					operator: this.aValues[i].operator,
					value1: this.aValues[i].value1,
					value2: this.aValues[i].value2
				}));
			}

			// create the new filter object based on the filters
			if (aFilters.length > 1) {
				var oFilter = new Filter({
					filters: aFilters,
					and: this.bAND
				});

				return oFilter;
			} else {
				return aFilters[0];
			}

		}
602609
protected function applyFilters()
  {
    if ($this->emptyRessource) {
      $source = $this->emptyRessource;
    } else if ($this->extension == self::IMAGE_TYPE_JPG) {
      $source = imagecreatefromjpeg($this->path);
    } else if ($this->extension == self::IMAGE_TYPE_PNG) {
      $source = imagecreatefrompng($this->path);
      imagealphablending($source, false);
      imagesavealpha($source, true);
    }
    foreach($this->filters as $filtre) {
      $source = $filtre->apply($source);
    }
    $this->buildedRessource = $source;
    return $source;
  }
1198716
private function applyFilters() : void
    {
        foreach ($this->criteria as $criteria) {
            $filterClass = $criteria->getOperator();

            $filter = new $filterClass(
                $this->table->aliasField($criteria->getField()),
                $criteria->getValue()
            );

            $filter->apply($this->query);
        }
    }
485409
function _applyFilters(rawdata, filterOptions) {
			var dataToWorkOn = (JSON.parse(JSON.stringify(rawdata)));
			var containerWidth = document.querySelector('#sapUiSupportPerfHeaderTimeline').offsetWidth - document.querySelector('#sapUiSupportPerfHeaderTimelineBarInfoWrapper').offsetWidth;
			var scrollWidth = 20;
			var filteredTime = 1;

			dataToWorkOn = _filterByTime(filterOptions.filterByTime, dataToWorkOn);
			dataToWorkOn = _sortBy(filterOptions.orderByValue, dataToWorkOn);
			dataToWorkOn = _filterMinValue(filterOptions.minValue, dataToWorkOn);

			if (dataToWorkOn.length) {
				filteredTime = filterOptions.filterByTime.end - filterOptions.filterByTime.start;
			}

			_widthSingleUnit = ((containerWidth - scrollWidth) / filteredTime); //ms in px

			return dataToWorkOn;
		}
675196
def edit_filter(self):
        """"""
        filters, valid = QInputDialog.getText(self, _('Edit filename filters'),
                                              _('Name filters:'),
                                              QLineEdit.Normal,
                                              ", ".join(self.name_filters))
        if valid:
            filters = [f.strip() for f in to_text_string(filters).split(',')]
            self.parent_widget.sig_option_changed.emit('name_filters', filters)
            self.set_name_filters(filters)
74392
public function renderFilters()
    {
        if (isset($_GET['filter'])) {
            if (isset($_GET['q'])) {
                $this->model->addCondition($_GET['filter'], 'like', '%'.$_GET['q'].'%');
            }
            // Apply filtering to filter.
            $this->applyFilters();
            $action = $this->model->action('field', [$_GET['filter']]);
            $action->group($_GET['filter']);
            $rows = $action->get();
            $data = [];
            foreach ($rows as $k => $v) {
                $data[] = ['id' => $k, 'name' => $v[$_GET['filter']]];
            }
            array_unshift($data, ['id' => -1, 'name' => $this->filterEmpty]);

            $this->app->terminate(json_encode([
                                                  'success' => true,
                                                  'results' => $data,
                                              ]));
        }
    }
119316
protected function getCustomFilters()
    {
        $filters = (array) $this->getOption('custom_filters');

        return array_filter(
            $filters,
            function ($name) {
                return is_string($name);
            },
            ARRAY_FILTER_USE_KEY
        );
    }
235490
private function filters() {
            // Override request for plugin information
            add_filter( 'plugins_api', array( &$this, 'plugins_api_filter' ), 10, 3 );

            $this->add_transient_filters();

            /**
             * If user has the premium plugin's code but do NOT have an active license,
             * encourage him to upgrade by showing that there's a new release, but instead
             * of showing an update link, show upgrade link to the pricing page.
             *
             * @since 1.1.6
             *
             */
            // WP 2.9+
            add_action( "after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
                &$this,
                'catch_plugin_update_row'
            ), 9 );
            add_action( "after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
                &$this,
                'edit_and_echo_plugin_update_row'
            ), 11, 2 );

            add_action( 'admin_head', array( &$this, 'catch_plugin_information_dialog_contents' ) );

            if ( ! WP_FS__IS_PRODUCTION_MODE ) {
                add_filter( 'http_request_host_is_external', array(
                    $this,
                    'http_request_host_is_external_filter'
                ), 10, 3 );
            }

            if ( $this->_fs->is_premium() ) {
                if ( ! $this->is_correct_folder_name() ) {
                    add_filter( 'upgrader_post_install', array( &$this, '_maybe_update_folder_name' ), 10, 3 );
                }

                add_filter( 'upgrader_pre_install', array( 'FS_Plugin_Updater', '_store_basename_for_source_adjustment' ), 1, 2 );
                add_filter( 'upgrader_source_selection', array( 'FS_Plugin_Updater', '_maybe_adjust_source_dir' ), 1, 3 );

                if ( ! $this->_fs->has_any_active_valid_license() ) {
                    add_filter( 'wp_prepare_themes_for_js', array( &$this, 'change_theme_update_info_html' ), 10, 1 );
                }
            }
        }