<commit_before>﻿/*global require*/
require(["gtfs-exchange"], function (Agencies) {
	"use strict";
	var agencyListUrl = "proxy.ashx?http://www.gtfs-data-exchange.com/api/agencies";

	function isInWA(val) {
		return val && val.country === "United States" && val.state === "Washington";
	}

	function createAgencyTable(/**Object[]*/ agencies) {
		var table, propNames, i, l, row, cell;
		if (agencies && agencies.length) {
			table = document.createElement("table");
			table.createTBody();
			// Get agency property names.
			propNames = Object.getOwnPropertyNames(agencies[0]);

			for (i = 0, l = agencies.length; i < l; i++) {
				row = table.insertRow(i);
				for (var j = 0, jl = propNames.length; j < jl; j += 1) {
					cell = row.insertCell(j);
					cell.textContent = String(agencies[i][propNames[j]]);
				}
			}

			table.createTHead();
			row = table.insertRow(0);
			for (i = 0, l = propNames.length; i < l; i += 1) {
				cell = row.insertCell(i);
				cell.textContent = propNames[i];
			}
		}

		return table;
		
	}

	function handleAgencyList(/**{string}*/ json) {<commit_msg>Loops now use Array.forEach.<commit_after>﻿/*global require*/
require(["gtfs-exchange"], function (Agencies) {
	"use strict";
	var agencyListUrl = "proxy.ashx?http://www.gtfs-data-exchange.com/api/agencies";

	function isInWA(val) {
		return val && val.country === "United States" && val.state === "Washington";
	}

	function createAgencyTable(/**Object[]*/ agencies) {
		var table, propNames, insertCell, row;



		if (agencies && agencies.length) {
			table = document.createElement("table");
			table.createTBody();
			// Get agency property names.
			propNames = Object.getOwnPropertyNames(agencies[0]);

			/** Inserts a cell into a row.
			 * @this {Object} Properties are row and agency.
			*/
			insertCell = function (propName, j) {
				var cell = this.row.insertCell(j);
				cell.textContent = String(this.agency[propName]);
			};

			// Add rows for each agency.
			agencies.forEach(function (agency, i) {
				var row = table.insertRow(i);
				propNames.forEach(insertCell, { row: row, agency: agency });
			});

			// Add the header
			table.createTHead();
			row = table.insertRow(0);

			propNames.forEach(function (propName, i) {
				var cell = row.insertCell(i);
				cell.textContent = propName;
			});
		}

		return table;
		
	}

	function handleAgencyList(/**{string}*/ json) {
{'fraction_non_alphanumeric': 0.1644295302013423, 'fraction_numerical': 0.0037751677852348995, 'mean_word_length': 3.441340782122905, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '2514453', 'n_tokens_mistral': 930, 'n_tokens_neox': 792, 'n_words': 185}