<commit_before>// 1. basic template parse with es6 template literal tag function
function getFullString(strings, ...interpolatedValues) { // `...` essentially slices the arguments for us.
  return strings.reduce((total, current, index) => { // use an arrow function for brevity here
    total += current;
    print('index: ' + index + ' | current: ' + current);

    if (interpolatedValues.hasOwnProperty(index)) {
      total += interpolatedValues[index];
      print("interpolatedValues[index]: " + interpolatedValues[index]);
    }
    return total;
  }, '');
}

const sb = 'SB',
  sbn = 'n-SB',
  sbs = 'SBS';
getFullString `basic template: Hello
${`nested template: ${sbn}`} and and ${sbs}`;


/*
 * 3. cleaner decoupled template fragments
 */

const capitalize = (string) => {
  return string[0].toUpperCase() + string.slice(1).toUpperCase();
};

const deleteBtn = ({person, isAdmin}) => {
    return isAdmin ? `<button>Delete ${capitalize(person)}</button>`: '';
};

const pplItem = ({person, isAdmin}) => {
  return `<li>
      <span>${capitalize(person)}</span>
      ${deleteBtn({person, isAdmin})}
    </li>`;
};

const pplList = ({people, isAdmin}) => {
  return `<ul>
    ${people.map(person => `${pplItem({person, isAdmin})}`)}<commit_msg>clean<commit_after>/**
 * 1. basic template parse with es6 template literal tag function
 */
function getFullString(strings, ...interpolatedValues) { // `...` essentially slices the arguments for us.
  return strings.reduce((total, current, index) => { // use an arrow function for brevity here
    total += current;
    print('index: ' + index + ' | current: ' + current);

    if (interpolatedValues.hasOwnProperty(index)) {
      total += interpolatedValues[index];
      print("interpolatedValues[index]: " + interpolatedValues[index]);
    }
    return total;
  }, '');
}

const sb = 'SB',
  sbn = 'n-SB',
  sbs = 'SBS';
getFullString `basic template: Hello
${`nested template: ${sbn}`} and and ${sbs}`;



/**
 * 2. cleaner decoupled template fragments
 */
const capitalize = (string) => {
  return string[0].toUpperCase() + string.slice(1).toUpperCase();
};

const deleteBtn = ({person, isAdmin}) => {
    return isAdmin ? `<button>Delete ${capitalize(person)}</button>`: '';
};

const pplItem = ({person, isAdmin}) => {
  return `<li>
      <span>${capitalize(person)}</span>
      ${deleteBtn({person, isAdmin})}
    </li>`;
};

const pplList = ({people, isAdmin}) => {
  return `<ul>
    ${people.map(person => `${pplItem({person, isAdmin})}`)}
{'fraction_non_alphanumeric': 0.18548065416832868, 'fraction_numerical': 0.003988831272437176, 'mean_word_length': 3.908023483365949, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 29, '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': '2525404', 'n_tokens_mistral': 819, 'n_tokens_neox': 797, 'n_words': 199}