Starts filter output.
508269
private void start()
    {
    try
      {
      // Initialize filter.
      initializeFilter( getFilterInput(), getFilterOutput());

      // Start filter thread.
      failure_ = null;
      thread_ = new Thread( this, String.valueOf( this));
      thread_.start();
      }
    catch( Exception e)
      {
      throw new RuntimeException( "Can't start filtering", e);
      } 
    }
17936
def main():
    """"""

    for entry in b6_evalue_filter(args.b6, args.e_value):
        args.output.write(entry.write())
1155475
public void startMonitoring()
    throws IOException 
  {
    if (file == null) {
      writer = new PrintWriter(new BufferedOutputStream(System.out));
    } else {
      writer = new PrintWriter(new FileWriter(file, true));
    }
    super.startMonitoring();
  }
357888
def main():
    
    parser = argparse.ArgumentParser(
        description='Executes a filter from the command-line. Calls JVM start/stop automatically.')
    parser.add_argument("-j", metavar="classpath", dest="classpath", help="additional classpath, jars/directories")
    parser.add_argument("-X", metavar="heap", dest="heap", help="max heap size for jvm, e.g., 512m")
    parser.add_argument("-i", metavar="input1", dest="input1", required=True, help="input file 1")
    parser.add_argument("-o", metavar="output1", dest="output1", required=True, help="output file 1")
    parser.add_argument("-r", metavar="input2", dest="input2", help="input file 2")
    parser.add_argument("-s", metavar="output2", dest="output2", help="output file 2")
    parser.add_argument("-c", metavar="classindex", default="-1", dest="classindex",
                        help="1-based class attribute index")
    parser.add_argument("filter", help="filter classname, e.g., weka.filters.AllFilter")
    parser.add_argument("option", nargs=argparse.REMAINDER, help="additional filter options")
    parsed = parser.parse_args()
    if parsed.input2 is None and parsed.output2 is not None:
        raise Exception("No second input file provided ('-r ...')!")

    jars = []
    if parsed.classpath is not None:
        jars = parsed.classpath.split(os.pathsep)
    params = []
    if parsed.input1 is not None:
        params.extend(["-i", parsed.input1])
    if parsed.output1 is not None:
        params.extend(["-o", parsed.output1])
    if parsed.input2 is not None:
        params.extend(["-r", parsed.input2])
    if parsed.output2 is not None:
        params.extend(["-s", parsed.output2])
    if parsed.classindex is not None:
        params.extend(["-c", parsed.classindex])

    jvm.start(jars, max_heap_size=parsed.heap, packages=True)

    logger.debug("Commandline: " + join_options(sys.argv[1:]))

    try:
        flter = Filter(parsed.filter)
        if len(parsed.option) > 0:
            flter.options = parsed.option
        loader = Loader(classname="weka.core.converters.ArffLoader")
        in1 = loader.load_file(parsed.input1)
        cls = parsed.classindex
        if str(parsed.classindex) == "first":
            cls = "0"
        if str(parsed.classindex) == "last":
            cls = str(in1.num_attributes - 1)
        in1.class_index = int(cls)
        flter.inputformat(in1)
        out1 = flter.filter(in1)
        saver = Saver(classname="weka.core.converters.ArffSaver")
        saver.save_file(out1, parsed.output1)
        if parsed.input2 is not None:
            in2 = loader.load_file(parsed.input2)
            in2.class_index = int(cls)
            out2 = flter.filter(in2)
            saver.save_file(out2, parsed.output2)
    except Exception, e:
        print(e)
    finally:
        jvm.stop()
416177
public function run() {

		foreach ( $this->filters as $hook ) {
			add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
		}

		foreach ( $this->actions as $hook ) {
			add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
		}

	}
1332473
public static function startOutputBuffer()
    {
        if (ob_get_level() > 1) {
            return;
        }
        
        $outputCallback = null;
        if (GZIP_SUPPORTED && !DISABLE_GZIP) {
            $outputCallback = 'ob_gzhandler';
        }
        
        if (in_array($outputCallback, ob_list_handlers())) {
            return; // don't start same handler twice
        }
        
        ob_start($outputCallback);
    }
845350
void initFilters() {
        tempFileNameScheme.setBaseDir(job.getInputDir());

        listFilter = new GenListModuleReader();
        listFilter.setLogger(logger);
        listFilter.setPrimaryDitamap(rootFile);
        listFilter.setJob(job);
        listFilter.setFormatFilter(formatFilter);

        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();

        ditaWriterFilter = new DitaWriterFilter();
        ditaWriterFilter.setTempFileNameScheme(tempFileNameScheme);
        ditaWriterFilter.setLogger(logger);
        ditaWriterFilter.setJob(job);
        ditaWriterFilter.setEntityResolver(reader.getEntityResolver());

        topicFragmentFilter = new TopicFragmentFilter(ATTRIBUTE_NAME_CONREF, ATTRIBUTE_NAME_CONREFEND);

    }
467435
def print_filters():
    """"""
    for filter_name in VALID_FILTERS:
        filter_func = getattr(filters, 'filter_{0}'.format(filter_name))
        description = filter_func.__doc__
        if description:
            description = re.sub(r'\n\s+', ' ', description)
            description.strip()

        print('{0}: {1}\n'.format(filter_name, description))
583982
void start() throws IOException, TooManyListenersException {
        inputStream = port.getInputStream();
        outputStream = port.getOutputStream();
        ReadWorker w = new ReadWorker();
        w.start();
        port.addEventListener(this);
        service.getIdleStatusChecker0().addSession(this);
        try {
            getService().getFilterChainBuilder().buildFilterChain(getFilterChain());
            serviceListeners.fireSessionCreated(this);
        } catch (Throwable e) {
            getFilterChain().fireExceptionCaught(e);
            processor.remove(this);
        }
    }
1027631
def run_filter_calculation(self):
        """"""
        inputs = {
            'cif': self.inputs.cif,
            'code': self.inputs.cif_filter,
            'parameters': self.inputs.cif_filter_parameters,
            'metadata': {
                'options': self.inputs.options.get_dict(),
            }
        }

        calculation = self.submit(CifFilterCalculation, **inputs)
        self.report('submitted {}<{}>'.format(CifFilterCalculation.__name__, calculation.uuid))

        return ToContext(cif_filter=calculation)
926835
def addFilter(self, filterclass):
        """"""
        if filterclass not in self.filters:
            self.filters.append(filterclass)
391216
@Override
    public void startGeneration() {
        metrics.startGeneration();
        getFilteredGenerators(parallelGeneration).forEach(this::useGenerator);
        metrics.stopGeneration();
    }
1336995
def do_newfilter(self, subcmd, opts):
        
        from mdlib.filterprocessor import RULES
        print(RULES, file=self.stdout)
895158
private function runFilters()
    {
        foreach ($this->filterObjects as $filter) {
            $filter_key = $filter->getKey();

            // Execute the filter method if enabled
            if ($this->request->has($filter_key)) {
                $filter_option = ucfirst(preg_replace('/[^a-z0-9]/i', ' ', $this->request->input($filter_key)));

                $filter_key = ucfirst(preg_replace('/[^a-z0-9]/i', ' ', $filter_key));

                if (!in_array($filter_option, $this->filters[$filter_key])) {
                    continue;
                }

                $filter_method = 'filter'.Str::studly($filter_key).Str::studly($filter_option);

                if (method_exists($this, $filter_method)) {
                    $this->$filter_method();
                }
            }
        }
    }
742379
protected function initFilters()
    {
        if (!empty($this->filters)) {
            foreach ($this->filters as $name => $handler) {
                $this->addFilter($name, $handler);
            }
        }
    }
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'
597942
private static void init(List<File> list, File dir, Filter filter)
    {
        File[] files = dir.listFiles();
        for (int i = 0; i < files.length; i++)
        {
            if (files[i].isDirectory())
            {
                init(list, files[i], filter);
            }
            else
            {
                if (filter == null || filter.accepts(files[i].getAbsolutePath()))
                {
                    list.add(files[i]);
                }
            }
        }
    }