Initialize reusable filters.
519217
private void initFilters() {
        listFilter = new GenListModuleReader();
        listFilter.setLogger(logger);
        listFilter.setPrimaryDitamap(rootFile);
        listFilter.setJob(job);

        if (profilingEnabled) {
            filterUtils = parseFilterFile();
        }

        if (INDEX_TYPE_ECLIPSEHELP.equals(transtype)) {
            exportAnchorsFilter = new ExportAnchorsFilter();
            exportAnchorsFilter.setInputFile(rootFile);
        }

        keydefFilter = new KeydefFilter();
        keydefFilter.setLogger(logger);
        keydefFilter.setCurrentFile(rootFile);
        keydefFilter.setJob(job);

        nullHandler = new DefaultHandler();
    }
375691
protected void init() {
        for (int i = 0; i < config.getFilter().getInclusions().size(); i++) {
            inclusions.add(Pattern.compile(config.getFilter().getInclusions().get(i)).asPredicate());
        }
        for (int i = 0; i < config.getFilter().getExclusions().size(); i++) {
            exclusions.add(Pattern.compile(config.getFilter().getExclusions().get(i)).asPredicate());
        }
    }
406576
def register_filters(self, filters, force=False):
        
        for filter_name, filter_ref in filters.items():
            self.register_filter(filter_name, filter_ref, force)
71438
def filters(self):
        """"""
        if self._filters is None:
            self._filters, self._attributes = self._fetch_configuration()
        return self._filters
988107
protected static void injectFilters() {
        if(injector != null ){
            if(Configuration.isTesting()){
                for (HttpSupportFilter filter : filters) {
                    injector.injectMembers(filter);
                }
            } else if (!filtersInjected) {
                for (HttpSupportFilter filter : filters) {
                    injector.injectMembers(filter);
                }
                filtersInjected = true;
            }
        }
    }
1211144
private static FilterInitializer[] getFilterInitializers(Configuration conf) {
    if (conf == null) {
      return null;
    }

    Class<?>[] classes = conf.getClasses(FILTER_INITIALIZER_PROPERTY);
    if (classes == null) {
      return null;
    }

    FilterInitializer[] initializers = new FilterInitializer[classes.length];
    for(int i = 0; i < classes.length; i++) {
      initializers[i] = (FilterInitializer)ReflectionUtils.newInstance(
          classes[i], conf);
    }
    return initializers;
  }
586513
private function initialize()
    {
        $this->extension = 'module';
        $this->extensions = [
            'module' => [],
            'theme' => [],
            'profile' => [],
        ];
        $this->filters = [
            'showInstalled' => false,
            'showUninstalled' => false,
            'showCore' => false,
            'showNoCore' => false
        ];
    }
557494
def filter(cls, filters, iterable):
    ''''''
    if isinstance(filters, Filter):
      filters = [filters]

    for filter in filters:
      iterable = filter.generator(iterable)

    return iterable
76118
public function initialize($value, $filters = [])
    {
        $this->value = $value;

        if (empty($filters)) return;

        //If a comma separated string is passed in, we can explode on it
        if (is_string($filters)) {
            $this->filters = explode(',', $filters);
        } else if (!is_array($filters)) {
            $this->filters = [$this->filters];
        } else {
            $this->filters = $filters;
        }
    }
723429
public void init(final FilterConfig filterConfig) {
        final String host = filterConfig.getInitParameter("host");
        if (StringUtils.isNotBlank(host)) {
            this.host = host;
        }
    }
1072745
def _init_filters(self):
        """"""
        self.filters = {}

        @self.template_filter()
        def format_ts(value, format_='%a, %b %d %Y %H:%M:%S'):
            """Formats the supplied timestamp using format_

            :param str value: The timestamp to be formatted
            :param str format_:  The format string
            :return: The correctly formatted timestamp as determined by format_
            :rtype: str
            """
            if format_ == '%s':
                return timestamp_to_sec(value)
            else:
                value = timestamp_to_datetime(value)
                return value.strftime(format_)

        @self.template_filter('urlsplit')
        def get_urlsplit(url):
            """Splits the supplied URL

            :param str url: The url to be split
            :return: The split url
            :rtype: urllib.parse.SplitResult
            """
            split = urlsplit(url)
            return split

        @self.template_filter()
        def tojson(obj):
            """Converts the supplied object/array/any to a JSON string if it can be JSONified

            :param any obj: The value to be converted to a JSON string
            :return: The JSON string representation of the supplied value
            :rtype: str
            """
            return json.dumps(obj)

        @self.template_filter()
        def tobool(bool_val):
            """Converts a python boolean to a JS "true" or "false" string
            :param any obj: A value to be evaluated as a boolean
            :return: The string "true" or "false" to be inserted into JS
            """

            return 'true' if bool_val else 'false'
746081
def register_filter(filter_cls):
    
    if filter_cls.name is None:
        return
    elif filter_cls.name in FILTER_REGISTRY:
        raise RuntimeError(
            "Filter class already registered: {}".format(filter_cls.name))
    else:
        FILTER_REGISTRY[filter_cls.name] = filter_cls
329636
function(filter) {
        if (!filter) {
            return;
        }
        if (!this.filters[filter.userId]) {
            this.filters[filter.userId] = {};
        }
        this.filters[filter.userId][filter.filterId] = filter;
    }
469624
private void init() {
		this.paused = false;
		this.stopped = true;
		this.tasksDoneCount = 0;
		this.tasksTotalCount = 0;
		this.initialized = false;

		// Add a default fetch filter and any custom ones
		defaultFetchFilter = new DefaultFetchFilter();
		this.addFetchFilter(defaultFetchFilter);
		
		for (FetchFilter filter : extension.getCustomFetchFilters()) {
			this.addFetchFilter(filter);
		}

		// Add a default parse filter and any custom ones
		this.addParseFilter(new DefaultParseFilter(spiderParam, extension.getMessages()));
		for (ParseFilter filter : extension.getCustomParseFilters())
			this.addParseFilter(filter);
		
		// Add the scan context, if any
		defaultFetchFilter.setScanContext(this.scanContext);
		defaultFetchFilter.setDomainsAlwaysInScope(spiderParam.getDomainsAlwaysInScopeEnabled());

	}
834264
def filters(self, filters):
        
        obj = []
        for fltr in filters:
            obj.append(fltr.jobject)
        javabridge.call(self.jobject, "setFilters", "([Lweka/filters/Filter;)V", obj)
590870
public void init(FilterConfig filterConfig)
        throws ServletException
    {
        _servletContext=filterConfig.getServletContext();
        _unwrappedDispatchSupported=Boolean.valueOf(filterConfig.getInitParameter("unwrappedDispatch")).booleanValue();
    }
362250
protected function initialisation()
	{
		foreach($this->table_schema as $name => $prop)
		{
			$this->columns[] = 't.' . $name;
			$this->filter_columns[] = $name;
			if( $this->check_type )
			{
				$this->setType($prop["type"], $name);
			}
		}
	}