<commit_before>define(["underscore", "jquery", "locale", "lib/leaflet", "optional!build/templates"],
       function(_, $, locale, L, templates) {
           /**
            * Takes a numeric string s and adds thousands separators.
            * For example: commas("12345678.3") -> "12,345,678.3"
            *
            * @param {string|Number} s A number or numeric string to format.
            *
            * @returns {string} A string with commas inserted
            */
           function commas(s) {
               if (!s) return "";

               s = s.toString();
               var split = s.split("."),
                   after = split[1];

               s = split[0];

               var l = s.length;
               if (l <= 3)
                   return s;

               var istart = 0,
                   iend = (l % 3) || 3,
                   pieces = [],
                   p;

               while ((p = s.slice(istart, iend))) {
                   pieces.push(p);
                   istart = iend;
                   iend += 3;
               }

               return pieces.join(",") + (after ? ("." + after) : "");
           }

           function ordinal(n) {
               n = "" + n;
               var ends = {"1": "st", "2": "nd", "3": "rd"},
                   end = "th";

               if (n.length < 2 || n[n.length-2] !== "1") {
                   end = ends[n[n.length-1]] || "th";
               }

               return n + end;
           }

           function prettyAmount(amount, currency) {
               currency = currency || "$";

               var mag = "";

               if (amount >= 10000) {
                   if (amount < 1000000) {
                       mag = "K";
                       amount /= 1000;
                   } else if (amount < 1000000000) {
                       mag = "M";
                       amount /= 1000000;
                   } else {
                       mag = "B";
                       amount /= 1000000000;
                   }

                   var amountStr = amount.toFixed(1).replace(/\.0$/, "");

                   return currency + amountStr + mag;
               }

               return currency + commas(amount);
           }

           function prettyDistance(ft) {
               var miles = ft/5280;

               if (miles >= 1) {
                   var m = miles.toFixed(1).replace(/\.0$/, "");
                   return m + " mile" + (miles - 1 < 0.1 ? "" : "s");
               } else if (miles >= 0.2) {
                   var denom, num;
                   if (miles > 0.5) {
                       denom = Math.round(1/(1-miles));
                       num = Math.round(miles*denom);

                   } else {
                       denom = Math.round(1/miles);
                       num = 1;
                   }

                   return "about <sup>" + num + "</sup>&frasl;<sub>" + denom + "</sub> mile";
               }

               return commas(ft) + " feet";
           }


           function prettyDate(d, format) {
               // TODO: Use the Internationalization API when available
               // https://marcoscaceres.github.io/jsi18n/
               if (!(d instanceof Date)) {
                   d = new Date(d);
               }

               if (isNaN(d)) {
                   return "unknown date";
               }<commit_msg>Report distances as decimals, not fractions<commit_after>define(["underscore", "jquery", "locale", "lib/leaflet", "optional!build/templates"],
       function(_, $, locale, L, templates) {
           /**
            * Takes a numeric string s and adds thousands separators.
            * For example: commas("12345678.3") -> "12,345,678.3"
            *
            * @param {string|Number} s A number or numeric string to format.
            *
            * @returns {string} A string with commas inserted
            */
           function commas(s) {
               if (!s) return "";

               s = s.toString();
               var split = s.split("."),
                   after = split[1];

               s = split[0];

               var l = s.length;
               if (l <= 3)
                   return s;

               var istart = 0,
                   iend = (l % 3) || 3,
                   pieces = [],
                   p;

               while ((p = s.slice(istart, iend))) {
                   pieces.push(p);
                   istart = iend;
                   iend += 3;
               }

               return pieces.join(",") + (after ? ("." + after) : "");
           }

           function ordinal(n) {
               n = "" + n;
               var ends = {"1": "st", "2": "nd", "3": "rd"},
                   end = "th";

               if (n.length < 2 || n[n.length-2] !== "1") {
                   end = ends[n[n.length-1]] || "th";
               }

               return n + end;
           }

           function prettyAmount(amount, currency) {
               currency = currency || "$";

               var mag = "";

               if (amount >= 10000) {
                   if (amount < 1000000) {
                       mag = "K";
                       amount /= 1000;
                   } else if (amount < 1000000000) {
                       mag = "M";
                       amount /= 1000000;
                   } else {
                       mag = "B";
                       amount /= 1000000000;
                   }

                   var amountStr = amount.toFixed(1).replace(/\.0$/, "");

                   return currency + amountStr + mag;
               }

               return currency + commas(amount);
           }

           function prettyFraction(dec) {
               var whole = Math.floor(dec),
                   frac = dec - whole,
                   denom, num;

               if (frac > 0.5) {
                   denom = Math.round(1/(1-frac));
                   num = Math.round(frac*denom);
               } else {
                   denom = Math.min(Math.round(1/frac), 10);
                   num = Math.round(frac*denom);
               }

               return [whole, num, denom];
           }

           function prettyDistance(ft) {
               var miles = ft/5280;

               if (miles >= 0.2) {
                   var m = miles.toFixed(1).replace(/\.0$/, "");
                   return m + " mile" + (Math.abs(miles - 1) < 0.1 ? "" : "s");
               }

               return commas(ft) + " feet";
           }


           function prettyDate(d, format) {
               // TODO: Use the Internationalization API when available
               // https://marcoscaceres.github.io/jsi18n/
               if (!(d instanceof Date)) {
                   d = new Date(d);
               }

               if (isNaN(d)) {
                   return "unknown date";
               }
{'fraction_non_alphanumeric': 0.1314294040507067, 'fraction_numerical': 0.028267521492058866, 'mean_word_length': 0.9029664541169947, 'pattern_counts': {'":': 6, '<': 17, '<?xml version=': 0, '>': 16, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '1331860', 'n_tokens_mistral': 1972, 'n_tokens_neox': 1725, 'n_words': 443}