<commit_before>// Copyright (c) 2015, Bitquant Research Laboratories (Asia) Limited
// Licensed under the Simplified BSD License

"use strict";
if (typeof define !== 'function') {
    var define = require('amdefine')(module);
}

define([], function() {
    function load_viewer(term_sheet, notes, callback, errback) {
require.config({
    paths: {
        "moment": "node_modules/moment/min/moment.min",
	"Calculator": "Calculator",
	"jquery" : "http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min",
	"modernizr" : "https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min",
	"jquery-ui" : "http://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min",
	"append-grid" :  "jquery.appendGrid-1.6.1.min",
	"polyfiller" :    "http://cdn.jsdelivr.net/webshim/1.15.10/polyfiller",
	"markdown" :
    "http://cdnjs.cloudflare.com/ajax/libs/pagedown/1.0/Markdown.Converter.min",
	"collapse" : "jquery.collapse",
	"handlebars" : "https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.3/handlebars.min"
    },
    shim: {
        "jquery-ui": {
            exports:"$" ,
            deps: ['jquery']
        },
	"markdown" : {
	    exports: "Markdown"
	},
        "append-grid": ['jquery-ui'],
        "collapse": ['jquery-ui'],
	"polyfiller" : {
	    exports: "webshims",
	    deps: ['modernizr']
	}
    },
    waitSeconds: 15
});
var analyze;




require ([
    term_sheet,
    "Calculator",
    notes,
    "handlebars",
    "moment",
    "markdown",
    "append-grid",
    "polyfiller",
    "collapse"], function(TermSheet, Calculator, Notes,
			 Handlebars,
			 moment) {

	function format_parties(t) {
	    Handlebars.registerHelper('toUpperCase', function(str) {
		return str.toUpperCase();
	    });
	    var templates = {
		"corporation" : (function() {/*
{{toUpperCase name}} incorporated and registered in {{domicile}} with company number {{company_number}} whose registered office is at {{registered_office}}{{extra}}
*/}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1],
		"person" : (function() {/*
{{toUpperCase name}} a resident of {{domicile}} located at {{registered_office}}{{extra}}
*/}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1]
	    };

	    var contact_template = (function() {/*
Address: {{address}}  
Email: {{email}}  
Attention: {{name}}  
*/}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1];

	    if (t.parties === undefined) {
		return;
	    }
	    t.parties_formatted = "";
	    t.contact_formatted = "";
	    t.parties.roles.forEach(function(role) {
		if (t.parties[role] !== undefined) {
		    var template = 
			Handlebars.compile(templates[t.parties[role].type]);
		    var compiled_contact_template =
			Handlebars.compile(contact_template);<commit_msg>use individual rather than person<commit_after>// Copyright (c) 2015, Bitquant Research Laboratories (Asia) Limited
// Licensed under the Simplified BSD License

"use strict";
if (typeof define !== 'function') {
    var define = require('amdefine')(module);
}

define([], function() {
    function load_viewer(term_sheet, notes, callback, errback) {
require.config({
    paths: {
        "moment": "node_modules/moment/min/moment.min",
	"Calculator": "Calculator",
	"jquery" : "http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min",
	"modernizr" : "https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min",
	"jquery-ui" : "http://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min",
	"append-grid" :  "jquery.appendGrid-1.6.1.min",
	"polyfiller" :    "http://cdn.jsdelivr.net/webshim/1.15.10/polyfiller",
	"markdown" :
    "http://cdnjs.cloudflare.com/ajax/libs/pagedown/1.0/Markdown.Converter.min",
	"collapse" : "jquery.collapse",
	"handlebars" : "https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.3/handlebars.min"
    },
    shim: {
        "jquery-ui": {
            exports:"$" ,
            deps: ['jquery']
        },
	"markdown" : {
	    exports: "Markdown"
	},
        "append-grid": ['jquery-ui'],
        "collapse": ['jquery-ui'],
	"polyfiller" : {
	    exports: "webshims",
	    deps: ['modernizr']
	}
    },
    waitSeconds: 15
});
var analyze;




require ([
    term_sheet,
    "Calculator",
    notes,
    "handlebars",
    "moment",
    "markdown",
    "append-grid",
    "polyfiller",
    "collapse"], function(TermSheet, Calculator, Notes,
			 Handlebars,
			 moment) {

	function format_parties(t) {
	    Handlebars.registerHelper('toUpperCase', function(str) {
		return str.toUpperCase();
	    });
	    var templates = {
		"corporation" : (function() {/*
{{toUpperCase name}} incorporated and registered in {{domicile}} with company number {{company_number}} whose registered office is at {{registered_office}}{{extra}}
*/}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1],
		"individual" : (function() {/*
{{toUpperCase name}} a resident of {{domicile}} located at {{address}}{{extra}}
*/}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1]
	    };

	    var contact_template = (function() {/*
Address: {{address}}  
Email: {{email}}  
Attention: {{name}}  
*/}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1];

	    if (t.parties === undefined) {
		return;
	    }
	    t.parties_formatted = "";
	    t.contact_formatted = "";
	    t.parties.roles.forEach(function(role) {
		if (t.parties[role] !== undefined) {
		    var template = 
			Handlebars.compile(templates[t.parties[role].type]);
		    var compiled_contact_template =
			Handlebars.compile(contact_template);
{'fraction_non_alphanumeric': 0.2056005895357406, 'fraction_numerical': 0.011790714812085483, 'mean_word_length': 3.3536487570168405, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '782376', 'n_tokens_mistral': 2045, 'n_tokens_neox': 1856, 'n_words': 313}