Filters the output removing useless preprocessor #directives
    and writes it to the given file or to the screen if no file is passed
428469
def output(memory, ofile=None):
    
    for m in memory:
        m = m.rstrip('\r\n\t ')  # Ensures no trailing newlines (might with upon includes)
        if m and m[0] == '#':  # Preprocessor directive?
            if ofile is None:
                print(m)
            else:
                ofile.write('%s\n' % m)
            continue

        # Prints a 4 spaces "tab" for non labels
        if m and ':' not in m:
            if ofile is None:
                print('    '),
            else:
                ofile.write('\t')

        if ofile is None:
            print(m)
        else:
            ofile.write('%s\n' % m)
269213
def scan(text, filename='(none)')
      warnings = scan_for_file_warnings(text, filename)
      text = filter_fixable(warnings).inject(text) do |text, warning|
        warning.fix(text)
      end
      with_fixing_piped_to_output do
        text.split(/\n/).each_with_index do |line, number|
          warnings.concat process_line(line, number + 1, filename)
        end
      end
      warnings += unused_method_warnings
      warnings
    end
1001742
def print_or_write(data)
      if opts[:output_file]
        File.open(opts[:output_file], "w") { |f| f.write(data) }
      else
        puts data
      end
    end
512231
def outputters(opts):
    '''
    
    '''
    ret = LazyLoader(
        _module_dirs(opts, 'output', ext_type_dirs='outputter_dirs'),
        opts,
        tag='output',
    )
    wrapped_ret = FilterDictWrapper(ret, '.output')
    # TODO: this name seems terrible... __salt__ should always be execution mods
    ret.pack['__salt__'] = wrapped_ret
    return wrapped_ret
1101511
def dump_declarations(declarations, file_path):
    

    with open(file_path, "w+") as f:
        print_declarations(declarations, writer=f.write)
941353
function filterFile(template) {
  // Find matches for parans
  var filterMatches = template.match(/\(([^)]+)\)/g);
  var filters = [];
  if (filterMatches) {
    filterMatches.forEach(function(filter) {
      filters.push(filter.replace('(', '').replace(')', ''));
      template = template.replace(filter, '');
    });
  }

  return { name: template, filters: filters };
}
21656
def _clean_output(v):
    
    out = copy.deepcopy(v)
    outb = out.pop("outputBinding", {})
    if "secondaryFiles" in outb:
        out["secondaryFiles"] = outb["secondaryFiles"]
    return out
763711
function cleanOutputDir(done) {
			var htmlDemoFileMask = path.join(o.destCss, o.fontBaseName + '*.{css,html}');
			var files = glob.sync(htmlDemoFileMask).concat(wf.generatedFontFiles(o));
			async.forEach(files, function(file, next) {
				fs.unlink(file, next);
			}, done);
		}
579905
def filter(args):
    
    p = OptionParser(filter.__doc__)
    p.add_option("--less", default=False, action="store_true",
                 help="filter the sizes < certain cutoff [default: >=]")
    p.set_outfile()

    opts, args = p.parse_args(args)

    if len(args) != 2:
        sys.exit(not p.print_help())

    fastafile, cutoff = args
    try:
        cutoff = int(cutoff)
    except ValueError:
        sys.exit(not p.print_help())

    f = Fasta(fastafile, lazy=True)

    fw = must_open(opts.outfile, "w")
    for name, rec in f.iteritems_ordered():

        if opts.less and len(rec) >= cutoff:
            continue

        if (not opts.less) and len(rec) < cutoff:
            continue

        SeqIO.write([rec], fw, "fasta")
        fw.flush()

    return fw.name
987752
def extract_directives(header)
        processed_header = String.new("")
        directives = []

        header.lines.each_with_index do |line, index|
          if directive = line[DIRECTIVE_PATTERN, 1]
            name, *args = Shellwords.shellwords(directive)
            if respond_to?("process_#{name}_directive", true)
              directives << [index + 1, name, *args]
              # Replace directive line with a clean break
              line = "\n"
            end
          end
          processed_header << line
        end

        processed_header.chomp!
        # Ensure header ends in a new line like before it was processed
        processed_header << "\n" if processed_header.length > 0 && header[-1] == "\n"

        return processed_header, directives
      end
503110
function filterFile(file, done) {
      if (files[file].partial) {
        // Discover whether it is explicitly declared as a partial.
        return done(null, files[file].partial)
      } else if (opts.pattern) {
        // Check if it matches the partial pattern.
        return done(null, minimatch(file, opts.pattern))
      }
      // The file is not a partial.
      done(null, false)
    }
1147351
def purge
      output.each do |file, format|
        if File.exist?(file)
          rm(file)
          report "Removed #{file}"
        end
      end
    end
314271
def filter_lines(input_file, output_file, translate=lambda line: line):
    
    filepath, lines = get_lines([input_file])[0]
    return filepath, [(tag, translate(line=line, tag=tag)) for (tag, line) in lines]
1126262
def write!(opts = {})
      if requires_output_file?
        raise NoMethodError, "You cannot use Image#write(output) with "\
                             "the #{current_utility} command"
      end

      command = build_command(path)
      run(command, opts)
      self
    end
504914
def out io ,level
      io.write "&#{@referenced} " if @referenced
      if( is_simple? )
        short_out(io,level)
      else
        long_out(io,level)
      end
    end
1132604
function filterFile(file, done) {
      // Ensure it matches the extension.
      const correctExtention = path.extname(file) === opts.extname

      // Make sure it has defined files.
      const hasFiles = files[file].files
      done(null, correctExtention && hasFiles)
    }
89502
function outputAll(cb) {
    cb = u.maybe(cb);

    var count = u.size(self.file$);
    var result = [];

    if (!defaultOutput || !count) return cb(log('statics.outputAll: no output'));

    var done = u.after(count, function() {
      log('output %s %s static files', defaultOutput.path, result.length);
      cb(result);
    });

    var omit = defaultOutput.omitRoutes;
    if (omit && !u.isArray(omit)) { omit = [omit]; }

    // TODO: re-use similar filter in generator.output and serve-scripts.outputAll
    var filterRe = new RegExp('^(/admin/|/server/' +
                (opts.editor ? '' : '|/pub/') +
                       (omit ? '|' + u.map(omit, u.escapeRegExp).join('|') : '') +
                              ')');

    u.each(self.file$, function(spo, reqPath) {
      if (filterRe.test(reqPath)) return done();

      var src = path.join(spo.sp.src.path, spo.file);
      var dest = path.join(defaultOutput.path, spo.sp.route, spo.file);

      // copy will create dirs if necessary
      fs.copy(src, dest, function(err) {
        if (err) return done(log(err));
        result.push(dest);
        done();
      });

    });
    return self; // chainable
  }