<commit_before>(function(){

  'use strict';

  $(document).ready(initialize);

  var hopArray = [];
  var maltArray = [];
  var boilVolume = 0;
  var totalVolume = 0;
  var origGravity = 0;
  var boilGravity = 0;
  var hopWeight = 0;
  var hopAAU = 0;
  var IBU = 0;

  function initialize(){
    $('.ingredient').click(getIngredient);
    $('#recipe_form').on('click', '.remove_button', removeLine);
    $('#ibu_button').click(getVolume);
    hideFields();
  }

  function hideFields(){
    $('#recipe_text').hide();
    $('#recipe_submit').hide();
  }

  function showFields(){
    $('#recipe_text').show();
    $('#recipe_submit').show();
  }

  function getIngredient(){
    addIngredient(this);
  }

  function addIngredient(data){
    var ingID = data.getAttribute('dataid');
    var ingType = data.getAttribute('datatype');
    var ingName = data.getAttribute('name');
    var ingUnit = data.getAttribute('dataunit');

    var $button = $('<button type="button">');
    $button.addClass('remove_button');
    $button.text('Remove '+ingName);
    var $line = $('<div>');
    var $ingID = $('<input>');
    $ingID.val(ingID);
    var $unit = $('<input>');
    $unit.val(ingUnit);
    var $weight = $('<input placeholder="Weight (oz)">');
    var $time = $('<input placeholder="Time (min)">');
    var $name = $('<input>');
    $name.val(ingName);

    $($line).addClass(ingType);
    $($line).append($button);
    $($line).append($ingID);
    $($line).append($weight);
    $($line).append($time);
    $($line).append($unit);
    $($line).append($name);
    $($ingID).hide();
    $($unit).hide();
    $($name).hide();
    $('#recipe_form').append($line);
  }

  function removeLine(){
    var parentLine = $(this).parent();
    parentLine.remove();
  }

  //-------Beer Calc---------//

  function getVolume(){
    totalVolume = $('#total_vol_input').val();
    boilVolume = $('#boil_vol_input').val();
    getHops();
  }

  function getHops(){
    hopArray = [];
    var hops = [];
    $('.hop').each(function(){
      hops.push($(this)[0]);
    });
    alphaAcids(hops);
  }

  function alphaAcids(data){
    for (var i=0; i<data.length; i++){
      var children = data[i].children;
      var id = children[1].value;
      var weight = children[2].value;
      var time = children[3].value;
      var aau = children[4].value;
      var name = children[5].value;
      var tempArray = [id, weight, time, aau, name];
      hopArray.push(tempArray);
    }
    getMalts();
  }

  function getMalts(){
    maltArray = [];
    var malts = [];
    $('.malt').each(function(){
      malts.push($(this)[0]);
    });
    PPG(malts);
  }

  function PPG(data){
    for (var i=0; i<data.length; i++){
      var children = data[i].children;
      var id = children[1].value;
      var weight = children[2].value;
      var time = children[3].value;
      var ppg = children[4].value;
      var name = children[5].value;
      var tempArray = [id, weight, time, ppg, name];
      maltArray.push(tempArray);
    }
    getIBU();
  }

  function writeText(){
    var string = "Total Volume "+totalVolume+"gallons | Boil Volume "+boilVolume+"gallons | "
    string += "Original Gravity "+origGravity.toFixed(3)+" | Boil Gravity "+boilGravity.toFixed(3)+" | "
    string += "IBU "+Math.round(IBU)+" | "
    string += parseHops();
    string += parseMalts();
    string += "Notes: "
    $('#recipe_text').val(string);
  }

  function parseHops(){
   var string = "";<commit_msg>Added new line character<commit_after>(function(){

  'use strict';

  $(document).ready(initialize);

  var hopArray = [];
  var maltArray = [];
  var boilVolume = 0;
  var totalVolume = 0;
  var origGravity = 0;
  var boilGravity = 0;
  var hopWeight = 0;
  var hopAAU = 0;
  var IBU = 0;

  function initialize(){
    $('.ingredient').click(getIngredient);
    $('#recipe_form').on('click', '.remove_button', removeLine);
    $('#ibu_button').click(getVolume);
    hideFields();
  }

  function hideFields(){
    $('#recipe_text').hide();
    $('#recipe_submit').hide();
  }

  function showFields(){
    $('#recipe_text').show();
    $('#recipe_submit').show();
  }

  function getIngredient(){
    addIngredient(this);
  }

  function addIngredient(data){
    var ingID = data.getAttribute('dataid');
    var ingType = data.getAttribute('datatype');
    var ingName = data.getAttribute('name');
    var ingUnit = data.getAttribute('dataunit');

    var $button = $('<button type="button">');
    $button.addClass('remove_button');
    $button.text('Remove '+ingName);
    var $line = $('<div>');
    var $ingID = $('<input>');
    $ingID.val(ingID);
    var $unit = $('<input>');
    $unit.val(ingUnit);
    var $weight = $('<input placeholder="Weight (oz)">');
    var $time = $('<input placeholder="Time (min)">');
    var $name = $('<input>');
    $name.val(ingName);

    $($line).addClass(ingType);
    $($line).append($button);
    $($line).append($ingID);
    $($line).append($weight);
    $($line).append($time);
    $($line).append($unit);
    $($line).append($name);
    $($ingID).hide();
    $($unit).hide();
    $($name).hide();
    $('#recipe_form').append($line);
  }

  function removeLine(){
    var parentLine = $(this).parent();
    parentLine.remove();
  }

  //-------Beer Calc---------//

  function getVolume(){
    totalVolume = $('#total_vol_input').val();
    boilVolume = $('#boil_vol_input').val();
    getHops();
  }

  function getHops(){
    hopArray = [];
    var hops = [];
    $('.hop').each(function(){
      hops.push($(this)[0]);
    });
    alphaAcids(hops);
  }

  function alphaAcids(data){
    for (var i=0; i<data.length; i++){
      var children = data[i].children;
      var id = children[1].value;
      var weight = children[2].value;
      var time = children[3].value;
      var aau = children[4].value;
      var name = children[5].value;
      var tempArray = [id, weight, time, aau, name];
      hopArray.push(tempArray);
    }
    getMalts();
  }

  function getMalts(){
    maltArray = [];
    var malts = [];
    $('.malt').each(function(){
      malts.push($(this)[0]);
    });
    PPG(malts);
  }

  function PPG(data){
    for (var i=0; i<data.length; i++){
      var children = data[i].children;
      var id = children[1].value;
      var weight = children[2].value;
      var time = children[3].value;
      var ppg = children[4].value;
      var name = children[5].value;
      var tempArray = [id, weight, time, ppg, name];
      maltArray.push(tempArray);
    }
    getIBU();
  }

  function writeText(){
    var string = "Total Volume "+totalVolume+"gallons | Boil Volume "+boilVolume+"gallons | "
    string += "Original Gravity "+origGravity.toFixed(3)+" | Boil Gravity "+boilGravity.toFixed(3)+" | "
    string += "IBU "+Math.round(IBU)+" | \n"
    string += parseHops();
    string += parseMalts();
    string += "Notes: "
    $('#recipe_text').val(string);
  }

  function parseHops(){
   var string = "";
{'fraction_non_alphanumeric': 0.208123289644246, 'fraction_numerical': 0.006625378078640358, 'mean_word_length': 3.053706946876824, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 17, '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': '3077659', 'n_tokens_mistral': 2402, 'n_tokens_neox': 2349, 'n_words': 474}