<commit_before>// TODO: testing
define([

  'performer/core',
  'performer/tag'

],
function(_, Tag) {

  Serialize = {};

  Serialize.standard = function(input, helpers) {

    var tmp,
        output,
        attributes,
        VALUE_NOT_IN_TAG = ['select'],
            SELF_CLOSING = ['img','input'],
                     tag = input.schema.tag;

    // if value belongs in tag, add it to attributes
    if(_.contains(VALUE_NOT_IN_TAG, tag)) {
      input.schema.value = input.value;
    }

    // build valid html key="value" pairs
    attributes = helpers.attr_html(input.schema.attributes);

    // build a selectbox
    if(input.schema.tag === 'select') {
      output = "<select "+attributes+">";
      _.each(input.schema.options,function(value, key) {
        tmp = (key === input.value ? " SELECTED" : "");
        output += "<option value=\""+_.escape(key)+"\""+tmp+">"+_.escape(value)+"</option>";
      });
      output += "</select>";
    }

    // build a checkbox
    if(input.schema.attributes.type === 'checkbox') {
      output = "<input type=\"tag\" name=\""+input.name+"\" value=\"false\"/>";
      output += "<"+(tag)+" "+attributes+"/>";
    }

    // build all others
    if(!output) {<commit_msg>add hidden field with false value for checkboxes<commit_after>// TODO: testing
define([

  'performer/core',
  'performer/tag'

],
function(_, Tag) {

  Serialize = {};

  Serialize.standard = function(input, helpers) {

    var tmp,
        output,
        attributes,
        VALUE_NOT_IN_TAG = ['select'],
            SELF_CLOSING = ['img','input'],
                     tag = input.schema.tag;

    // if value belongs in tag, add it to attributes
    if(_.contains(VALUE_NOT_IN_TAG, tag)) {
      input.schema.value = input.value;
    }

    // build valid html key="value" pairs
    attributes = helpers.attr_html(input.schema.attributes);

    // build a selectbox
    if(input.schema.tag === 'select') {
      output = "<select "+attributes+">";
      _.each(input.schema.options,function(value, key) {
        tmp = (key === input.value ? " SELECTED" : "");
        output += "<option value=\""+_.escape(key)+"\""+tmp+">"+_.escape(value)+"</option>";
      });
      output += "</select>";
    }

    // build a checkbox
    if(input.schema.attributes.type === 'checkbox') {
      output = "<input type=\"hidden\" name=\""+input.name+"\" value=\"false\"/>";
      output += "<"+(tag)+" "+attributes+"/>";
    }

    // build all others
    if(!output) {
{'fraction_non_alphanumeric': 0.1898632341110217, 'fraction_numerical': 0.0, 'mean_word_length': 2.4929775280898876, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '3855510', 'n_tokens_mistral': 785, 'n_tokens_neox': 758, 'n_words': 163}