<commit_before>'use strict';

let cli = require('heroku-cli-util');
let co  = require('co');
let opn = require('opn');
let fs  = require('fs');

function open (url) {
  cli.log(`Opening ${cli.color.cyan(url)}...`);
  return new Promise(function (fulfill, reject) {
    opn(url, {wait: false}, function (err) {
      if (!err) return fulfill();
      cli.error('Cannot open page.');
      cli.error(err);
      reject(new Error(`Open ${cli.color.cyan(url)} in your browser.`));
    });
  });
}

const ssoPath = '/tmp/heroku-sso.html';

function writeTemplate (ctx, sso, path) {
  return new Promise(function (fulfill, reject) {
    let html = `<!DOCTYPE HTML>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Heroku Add-ons SSO</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
  </head>

  <body>
    <h3>Opening ${ctx.args.addon} on ${ctx.app}...</h3>
    <form method="POST" action="${sso.action}">
    </form>

    <script type="text/javascript">
      var params = ${JSON.stringify(sso.params)};
      var form = document.forms[0];
      $(document).ready(function() {
        $.each(params, function(key, value) {<commit_msg>fix app display when undefined<commit_after>'use strict';

let cli = require('heroku-cli-util');
let co  = require('co');
let opn = require('opn');
let fs  = require('fs');

function open (url) {
  cli.log(`Opening ${cli.color.cyan(url)}...`);
  return new Promise(function (fulfill, reject) {
    opn(url, {wait: false}, function (err) {
      if (!err) return fulfill();
      cli.error('Cannot open page.');
      cli.error(err);
      reject(new Error(`Open ${cli.color.cyan(url)} in your browser.`));
    });
  });
}

const ssoPath = '/tmp/heroku-sso.html';

function writeTemplate (ctx, sso, path) {
  return new Promise(function (fulfill, reject) {
    let html = `<!DOCTYPE HTML>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Heroku Add-ons SSO</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
  </head>

  <body>
    <h3>Opening ${ctx.args.addon}${ctx.app ? ` on ${ctx.app}` : ''}...</h3>
    <form method="POST" action="${sso.action}">
    </form>

    <script type="text/javascript">
      var params = ${JSON.stringify(sso.params)};
      var form = document.forms[0];
      $(document).ready(function() {
        $.each(params, function(key, value) {
{'fraction_non_alphanumeric': 0.20151939224310275, 'fraction_numerical': 0.005597760895641743, 'mean_word_length': 3.420494699646643, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6433594', 'n_tokens_mistral': 894, 'n_tokens_neox': 878, 'n_words': 191}