<commit_before>calculateRegistrationSubtotal = function (registration) {
  var accommodationsFee; // Used for accommodations price
  var calculatedDiscount; // Used for discount price
  var linens; // used for overnight registrations
  var subtotal; // Hold subtotal prior to discount

  // Calculate accommodations fee
  try {
    accommodationsFee = calculateAccommodationsFee(registration);
  } catch (error) {
    console.log(error.message);
  }

  // Calculate linens fee, if applicable
  try {
    linensFee = calculateLinensFee(registration);
  } catch (error) {
    console.log(error.message);
  }

  // Calculate discount based on half days
  try {
    calculatedDiscount = calculateDiscountDaysDiscount(registration);
  } catch (error) {
    console.log(error.message);
  }

  // Get the subtotal used for final calculations
  // based on accommodations, linens, and first time attender/half day discounts
  subtotal = accommodationsFee + linensFee - calculatedDiscount;

  return subtotal;
};<commit_msg>Prevent function from overriding global variable<commit_after>calculateRegistrationSubtotal = function (registration) {
  var accommodationsFee; // Used for accommodations price
  var registrationLinensFee; // Used for linens fee calculation
  var calculatedDiscount; // Used for discount price
  var linens; // used for overnight registrations
  var subtotal; // Hold subtotal prior to discount

  // Calculate accommodations fee
  try {
    accommodationsFee = calculateAccommodationsFee(registration);
  } catch (error) {
    console.log(error.message);
  }

  // Calculate linens fee, if applicable
  try {
    registrationLinensFee = calculateLinensFee(registration);
  } catch (error) {
    console.log(error.message);
  }

  // Calculate discount based on half days
  try {
    calculatedDiscount = calculateDiscountDaysDiscount(registration);
  } catch (error) {
    console.log(error.message);
  }

  // Get the subtotal used for final calculations
  // based on accommodations, linens, and first time attender/half day discounts
  subtotal = accommodationsFee + registrationLinensFee - calculatedDiscount;

  return subtotal;
};
{'fraction_non_alphanumeric': 0.08035299581978635, 'fraction_numerical': 0.0, 'mean_word_length': 3.986111111111111, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7561191', 'n_tokens_mistral': 607, 'n_tokens_neox': 572, 'n_words': 178}