Generates a doc page with formatter result examples
@param  {Object} formatterInfo Linting results from each formatter
@param  {string} [prereleaseVersion] The version used for a prerelease. This
changes where the output is stored.
@returns {void}
519209
function generateFormatterExamples(formatterInfo, prereleaseVersion) {
    const output = ejs.render(cat("./templates/formatter-examples.md.ejs"), formatterInfo);
    let filename = "../eslint.github.io/docs/user-guide/formatters/index.md",
        htmlFilename = "../eslint.github.io/docs/user-guide/formatters/html-formatter-example.html";

    if (prereleaseVersion) {
        filename = filename.replace("/docs", `/docs/${prereleaseVersion}`);
        htmlFilename = htmlFilename.replace("/docs", `/docs/${prereleaseVersion}`);
        if (!test("-d", path.dirname(filename))) {
            mkdir(path.dirname(filename));
        }
    }

    output.to(filename);
    formatterInfo.formatterResults.html.result.to(htmlFilename);
}
876047
function getBrowserVersion(version) {
  if (!version) {
    return {
      major: '',
      minor: '',
    };
  }
  var parts = version.split('.');
  return {
    major: parts[0],
    minor: parts[1],
  };
}
1252548
function main(options = util.getDefaultOptions()) {
  createLogger(options.debug);
  log.info(`Preparing '${options.sdk}' schemas in version '${options.version || 'latest'}'...`);

  let allLibs = {};

  // do the downloading and encapsulate in Promise
  const dlPromise = new Promise((resolve, reject) => {
    download.allLibsFile(options)
      .then((allLibsJSON) => {
        allLibs = allLibsJSON;
        download.schemas(options, allLibs)
          .then((values) => {
            resolve(values);
          })
          .catch((e) => {
            reject(e);
          });
      })
      .catch((e) => {
        reject(e);
      });
  });


  dlPromise.then(() => {
    log.info('Yay, all schema files were successfully downloaded!');
    if (options.upgrade) {
      upgrade(options, allLibs);
    }
    if (options.link) {
      link(options, allLibs);
    }
  }, (e) => {
    log.error('Damn... Something went all wrong while downloading the schema files!');
    log.error(`Are you sure the version '${options.version}' is still available on '${options.sdk}' download pages?`);
    log.error(e);
  });
}
1106791
public boolean recordVersion(String version) {
    if (currentInfo.documentVersion(version)) {
      populated = true;
      return true;
    } else {
      return false;
    }
  }
985608
private String formatVersion(String version) {
        if (version == null) {
            return version;
        }
        String[] split = version.split(GERRIT_VERSION_PREFIX);
        if (split.length < 2) {
            return version.trim();
        }
        return split[1].trim();
    }
309360
function formatter (results) {
  const warnings = []
  const errors = []

  results.forEach(result => {
    if (!result.warnings.length) {
      errors.push(result)
      return
    }

    const warningMessages = []
    const errorMessages = []

    result.warnings.forEach(message => {
      if (message.severity === 'warning') {
        warningMessages.push(message)
      } else {
        errorMessages.push(message)
      }
    })

    warnings.push(Object.assign({}, result, { warnings: warningMessages }))
    errors.push(Object.assign({}, result, { warnings: errorMessages }))
  })

  return stringFormatter([].concat(warnings, errors))
}
80599
function verSuffix(i) {
		var rtn = {
			prerelease : '',
			metadata : '',
			prereleaseVersions : null
		};
		if (self.versionMatch.length <= i) {
			return rtn;
		}
		var v = self.versionMatch[i];
		// reset the last index so the tests will be accurate
		regexVerCurrBumpNum.lastIndex = 0;
		// replace place holders with current or bumped version
		var vi = -1;
		var pvers = self.prev && self.prev.versionPrerelease && self.prev.versionPrerelease.match(regexVerNum);
		var mdi = v.lastIndexOf(charVerMeta);
		var lsti = v.length - 1;
		v = v.replace(regexVerCurrBumpNum, function verCurrRepl(m, cg, bg, ng, off) {
			vi++;
			if (ng) {
				return m;
			}
			if (cg) {
				// match previous rerelease version slots with the current place
				// holder slot (if any)
				self.versionPrevIndices.push(++si);
				return pvers && pvers.length > vi ? pvers[vi] : 0;
			} else if (bg) {
				// only increment when the bump is not the last instance or is
				// the last instance, but there is metadata following its
				// occurrence
				if (mdi === lsti || mdi !== off || (off + m.length - 1) === lsti) {
					self.versionBumpedIndices.push(++si);
					return (pvers && pvers.length > vi ? +pvers[vi] : 0) + m.length;
				}
			}
			return m;
		});
		// separate metadata from the prerelease
		mdi = v.indexOf(charVerMeta);
		if (mdi >= 0) {
			rtn.prerelease = mdi === 0 ? '' : v.substring(0, mdi);
			rtn.metadata = v.substring(mdi);
		} else {
			rtn.prerelease = v;
		}
		return rtn;
	}
906796
function outputVersion () {
  fs.readFile(path.join(__dirname, '/../package.json'), function (err, data) {
    if (err) {
      console.log(err.toString())
    } else {
      const pkg = JSON.parse(data)
      const version = pkg && pkg.version ? pkg.version : 'unknown'
      console.log(version)
    }
    process.exit(0)
  })
}
1331362
async function markVersions () {
  const packages = JSON.parse(
    (await execa(require.resolve('lerna/cli'), ['list', '--json'])).stdout
  ).filter(p => !p.private)
  const markerPath = path.resolve(__dirname, '../packages/vue-cli-version-marker/package.json')
  const marker = JSON.parse(fs.readFileSync(markerPath))

  const curVersion = marker.version
  const mainVersion = require('../lerna.json').version

  if (semver.prerelease(mainVersion)) {
    marker.version = mainVersion
  } else {
    const releaseType = semver.diff(curVersion, mainVersion) || 'patch'
    marker.version = semver.inc(marker.version, releaseType)
  }

  marker.devDependencies = packages.reduce((prev, pkg) => {
    prev[pkg.name] = pkg.version
    return prev
  }, {})
  fs.writeFileSync(markerPath, JSON.stringify(marker, null, 2))
}
754462
function(version) {
        version = version || this.defaultVersion;
        var profile = this.profile ? "_" + this.profile : "";
        if(!this.parser || this.parser.VERSION != version) {
            var format = OpenLayers.Format[this.name][
                "v" + version.replace(/\./g, "_") + profile
            ];
            if(!format) {
                if (profile !== "" && this.allowFallback) {
                    // fallback to the non-profiled version of the parser
                    profile = "";
                    format = OpenLayers.Format[this.name][
                        "v" + version.replace(/\./g, "_")
                    ];
                }
                if (!format) {
                    throw "Can't find a " + this.name + " parser for version " +
                          version + profile;
                }
            }
            this.parser = new format(this.options);
        }
        return this.parser;
    }
739257
function (inputVersion, outputVersion) {
        var converter;

        inputVersion = semver.clean(inputVersion);
        outputVersion = semver.clean(outputVersion);

        for (converter in this.converters) {
            // eslint-disable-next-line no-prototype-builtins
            converter = this.converters.hasOwnProperty(converter) && this.converters[converter];
            if (converter && semver.eq(converter.input, inputVersion) && semver.eq(converter.output, outputVersion)) {
                return generateConverter(converter);
            }
        }
    }
269446
function processOutput(generator, startOutput) {
    return Promise(startOutput)
    .then(preparePlugins)
    .then(preparePages)
    .then(prepareAssets)

    .then(
        callHook.bind(null,
            'config',
            function(output) {
                var book = output.getBook();
                var config = book.getConfig();
                var values = config.getValues();

                return values.toJS();
            },
            function(output, result) {
                var book = output.getBook();
                var config = book.getConfig();

                config = config.updateValues(result);
                book = book.set('config', config);
                return output.set('book', book);
            }
        )
    )

    .then(
        callHook.bind(null,
            'init',
            function(output) {
                return {};
            },
            function(output) {
                return output;
            }
        )
    )

    .then(function(output) {
        if (!generator.onInit) {
            return output;
        }

        return generator.onInit(output);
    })

    .then(generateAssets.bind(null, generator))
    .then(generatePages.bind(null, generator))

    .tap(function(output) {
        var book = output.getBook();

        if (!book.isMultilingual()) {
            return;
        }

        var logger = book.getLogger();
        var books = book.getBooks();
        var outputRoot = output.getRoot();
        var plugins = output.getPlugins();
        var state = output.getState();
        var options = output.getOptions();

        return Promise.forEach(books, function(langBook) {
            // Inherits plugins list, options and state
            var langOptions = options.set('root', path.join(outputRoot, langBook.getLanguage()));
            var langOutput = new Output({
                book:       langBook,
                options:    langOptions,
                state:      state,
                generator:  generator.name,
                plugins:    plugins
            });

            logger.info.ln('');
            logger.info.ln('generating language "' + langBook.getLanguage() + '"');
            return processOutput(generator, langOutput);
        });
    })

    .then(callHook.bind(null,
        'finish:before',
            function(output) {
                return {};
            },
            function(output) {
                return output;
            }
        )
    )

    .then(function(output) {
        if (!generator.onFinish) {
            return output;
        }

        return generator.onFinish(output);
    })

    .then(callHook.bind(null,
        'finish',
            function(output) {
                return {};
            },
            function(output) {
                return output;
            }
        )
    );
}
712514
function formatResults (results) {
  return results.map(function (r) {
    return {
      fullName: r.fullName,
      hz: r.hz,
      hzDeviation: r.hzDeviation
    }
  })
}
41349
function showPrinterSettings() {

        fillAndSetBinsList();

        var $dlg = $('#dlg-printersettings');
        var printer = MeadCo.ScriptX.Printing;
        $dlg.find('#fld-collate').prop('checked', printer.collate);
        $dlg.find('#fld-copies').val(printer.copies);

    }
817332
function printHelpInformation(examples, pkg) {
  let cmdName = this._name;
  if (this._alias) {
    cmdName = `${cmdName}|${this._alias}`;
  }

  const sourceInformation = pkg
    ? [`${chalk.bold('Source:')} ${pkg.name}@${pkg.version}`, '']
    : [];

  let output = [
    chalk.bold(`react-native ${cmdName}`),
    this._description ? `\n${this._description}\n` : '',
    ...sourceInformation,
    `${chalk.bold('Options:')}`,
    this.optionHelp().replace(/^/gm, '  '),
  ];

  if (examples && examples.length > 0) {
    const formattedUsage = examples
      .map(example => `  ${example.desc}: \n  ${chalk.cyan(example.cmd)}`)
      .join('\n\n');

    output = output.concat([chalk.bold('\nExample usage:'), formattedUsage]);
  }

  return output.join('\n').concat('\n');
}
280341
function parserOnHeadersComplete(info) {
  var parser = this;
  var headers = info.headers;
  var url = info.url;

  if (!headers) {
    headers = parser._headers;
    parser._headers = [];
  }

  if (!url) {
    url = parser._url;
    parser._url = '';
  }

  parser.incoming = new IncomingMessage(parser.socket);
  parser.incoming.httpVersionMajor = info.versionMajor;
  parser.incoming.httpVersionMinor = info.versionMinor;
  parser.incoming.httpVersion = info.versionMajor + '.' + info.versionMinor;
  parser.incoming.url = url;

  var n = headers.length;

  // If parser.maxHeaderPairs <= 0 - assume that there're no limit
  if (parser.maxHeaderPairs > 0) {
    n = Math.min(n, parser.maxHeaderPairs);
  }

  for (var i = 0; i < n; i += 2) {
    var k = headers[i];
    var v = headers[i + 1];
    parser.incoming._addHeaderLine(k, v);
  }


  if (info.method) {
    // server only
    parser.incoming.method = info.method;
  } else {
    // client only
    parser.incoming.statusCode = info.statusCode;
    // CHECKME dead code? we're always a request parser
  }

  parser.incoming.upgrade = info.upgrade;

  var skipBody = false; // response to HEAD or CONNECT

  if (!info.upgrade) {
    // For upgraded connections and CONNECT method request,
    // we'll emit this after parser.execute
    // so that we can capture the first part of the new protocol
    skipBody = parser.onIncoming(parser.incoming, info.shouldKeepAlive);
  }

  return skipBody;
}
754512
def plain_doc(file)
      if @listings==true then
        puts listings_preamble
      elsif @pre==nil then
        puts "\\documentclass[12pt,a4paper]{jsarticle}"
        puts "\\usepackage[dvipdfmx]{graphicx}"
      else
        puts File.read(@pre)
      end
      puts "\\begin{document}"
      puts File.read(@head) if @head!=nil
      plain_tex = HikiDoc.to_latex(File.read(file),{:listings=>@listings})
      puts mod_abstract(plain_tex)
      puts File.read(@post) if @post!=nil
      puts "\\end{document}"
    end