<commit_before>'use strict';


(function (module) {

  const results = {};

  $('.zip-code-form button').on('click', function (e) {
    e.preventDefault();
    let $inputValue = $('.zip-code-form input').val();
    let inputValidity = validate($inputValue);
    localStorage.clear();
    if (inputValidity) {
      localStorage.inputAddress = $inputValue;
      window.location.href = '/results';
    } else {
      console.log('invalid');
      let inputBox = document.getElementById('zip');
      inputBox.setCustomValidity('Enter a Valid Zip Code or Address');
      inputBox.reportValidity();
    }

  });


  function Official(offTitle, name, div, email, phone, url, addr, party, divFormatted) {
    this.officeTitle = offTitle,
      this.name = name,
      this.division = div,
      this.email = email,
      this.phone = phone,
      this.url = url,
      this.address = addr,
      this.party = party,
      this.divFormatted = divFormatted;
  }
  Official.all = [];

  results.fetchAll = function (callback) {
    Official.all = [];
    console.log(localStorage.inputAddress)

    $.ajax({
      url: `https://www.googleapis.com/civicinfo/v2/representatives?key=${process.env.GOOGLE_KEY}&address=${localStorage.inputAddress}`,
      method: 'GET',
      complete: (data) => {
        let officials = data.responseJSON.officials;
        let offices = data.responseJSON.offices;

        offices.map((office) => {
          let divFormatted = results.formatDivision(office); // breaks down weird division string into an object that is easier to work with.

          office.officialIndices.map((ind) => {
            //TODO: clean up this function. If else is sloppy.
            if (!officials[ind].emails) {
              officials[ind].emails = 'none';
            } else {
              officials[ind].emails = officials[ind].emails[0];
            }

            if (!officials[ind].urls) {
              officials[ind].urls = 'none';
            } else {
              officials[ind].urls = officials[ind].urls[0];<commit_msg>got rid of fluid key<commit_after>'use strict';


(function (module) {

  const results = {};
  const GOOGLE_KEY = '<KEY>';

  $('.zip-code-form button').on('click', function (e) {
    e.preventDefault();
    let $inputValue = $('.zip-code-form input').val();
    let inputValidity = validate($inputValue);
    localStorage.clear();
    if (inputValidity) {
      localStorage.inputAddress = $inputValue;
      window.location.href = '/results';
    } else {
      console.log('invalid');
      let inputBox = document.getElementById('zip');
      inputBox.setCustomValidity('Enter a Valid Zip Code or Address');
      inputBox.reportValidity();
    }

  });


  function Official(offTitle, name, div, email, phone, url, addr, party, divFormatted) {
    this.officeTitle = offTitle,
      this.name = name,
      this.division = div,
      this.email = email,
      this.phone = phone,
      this.url = url,
      this.address = addr,
      this.party = party,
      this.divFormatted = divFormatted;
  }
  Official.all = [];

  results.fetchAll = function (callback) {
    Official.all = [];
    console.log(localStorage.inputAddress)

    $.ajax({
      url: `https://www.googleapis.com/civicinfo/v2/representatives?key=${GOOGLE_KEY}&address=${localStorage.inputAddress}`,
      method: 'GET',
      complete: (data) => {
        let officials = data.responseJSON.officials;
        let offices = data.responseJSON.offices;

        offices.map((office) => {
          let divFormatted = results.formatDivision(office); // breaks down weird division string into an object that is easier to work with.

          office.officialIndices.map((ind) => {
            //TODO: clean up this function. If else is sloppy.
            if (!officials[ind].emails) {
              officials[ind].emails = 'none';
            } else {
              officials[ind].emails = officials[ind].emails[0];
            }

            if (!officials[ind].urls) {
              officials[ind].urls = 'none';
            } else {
              officials[ind].urls = officials[ind].urls[0];
{'fraction_non_alphanumeric': 0.14018009247992214, 'fraction_numerical': 0.0014602092966658554, 'mean_word_length': 2.4683544303797467, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 10, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '1986113', 'n_tokens_mistral': 1223, 'n_tokens_neox': 1192, 'n_words': 260}