<commit_before>(function() {
  var Faker, fs, genie, moment, _;

  Faker = require('Faker');

  moment = require('moment');

  _ = require("underscore");

  fs = require('fs');

  Faker.Genie = {
    fullName: function() {
      return Faker.Name.findName.apply(Faker.Name);
    },
    ipAddress: function() {
      return Faker.Internet.ip.apply(Faker.Internet);
    },
    zipCode5: function() {
      return Faker.Address.zipCodeFormat(0);
    },
    zipCode9: function() {
      return Faker.Address.zipCodeFormat(1);
    },
    brStateAbbr: function() {
      return Faker.Address.brState(true);
    },
    usStateAbbr: function() {
      return Faker.Address.usState(true);
    },
    pattern: function(pattern) {
      var f, fakerPattern, n;

      fakerPattern = _.flatten((function() {
        var _results;

        _results = [];
        for (n in Faker) {
          _results.push((function() {
            var _results1;

            _results1 = [];
            for (f in Faker[n]) {
              if (f === pattern) {
                _results1.push({
                  func: Faker[n][f],
                  context: Faker[n]
                });
              }
            }
            return _results1;
          })());
        }
        return _results;
      })());
      if (fakerPattern && fakerPattern.length > 0) {
        return fakerPattern[0].func.apply(fakerPattern[0].context);
      } else {
        throw new Error("invalid pattern: " + pattern);
      }
    },
    format: function(format) {
      return Faker.Helpers.replaceSymbolWithNumber(format);
    },
    oneOf: function(items) {
      return Faker.random.array_element(items);
    },
    someOf: function(items, min, max) {
      var candidate, count, excludeCount, excluded, itemsLeft, selected;

      count = min + Faker.Helpers.randomNumber(min - max);
      if (items.length <= count) {
        return items;
      } else {
        excluded = [];
        excludeCount = items.length - count;
        while (excluded.length < excludeCount) {
          itemsLeft = _.without(items, excluded);
          candidate = Faker.random.array_element(itemsLeft);
          excluded.push(candidate);
        }
        return selected = _.without(items, excluded);
      }
    },
    weightedSample: function(items) {
      var i, itemMap, seed, total, value, _i, _len;

      itemMap = _.map(items, function(item) {
        var o;

        return o = {
          weight: item[0],
          value: item[1]
        };
      });
      total = _.reduce(itemMap, function(memo, item) {
        item.range = [memo, memo + item.weight - 0.0001];
        return memo + item.weight;
      }, 0);
      seed = Math.random() * total;
      value = null;
      for (_i = 0, _len = itemMap.length; _i < _len; _i++) {
        i = itemMap[_i];
        if (seed >= i.range[0] && seed <= i.range[1]) {
          value = i.value;
          break;
        }
      }
      return value;
    }
  };

  genie = function(template) {
    var arr, c, count, current, i, max, min, obj, places, _i, _ref, _ref1, _ref2, _ref3;

    obj = {};
    for (c in template) {
      current = template[c];
      if (!current.exists || (current != null ? current.exists.apply(obj, [Faker.Genie]) : void 0)) {
        if (_.isFunction(current)) {
          obj[c] = current.apply(obj, [Faker.Genie]);
        } else if (current.template) {
          min = current.min || ((_ref = current.range) != null ? _ref[0] : void 0) || 0;
          max = current.max || ((_ref1 = current.range) != null ? _ref1[1] : void 0) || 5;
          if (!current.min && !current.max) {
            obj[c] = genie(current.template);
          } else {
            count = Faker.Helpers.randomNumber(max - min);
            arr = [];
            for (i = _i = 1; 1 <= count ? _i <= count : _i >= count; i = 1 <= count ? ++_i : --_i) {
              arr.push(genie(current.template));
            }
            obj[c] = arr;
          }
        } else if (current.minAge || current.maxAge) {<commit_msg>Added randomInRange<commit_after>// Generated by CoffeeScript 1.5.0
(function() {
  var Faker, fs, genie, moment, _;

  Faker = require('Faker');

  moment = require('moment');

  _ = require("underscore");

  fs = require('fs');

  Faker.Genie = {
    fullName: function() {
      return Faker.Name.findName.apply(Faker.Name);
    },
    ipAddress: function() {
      return Faker.Internet.ip.apply(Faker.Internet);
    },
    zipCode5: function() {
      return Faker.Address.zipCodeFormat(0);
    },
    zipCode9: function() {
      return Faker.Address.zipCodeFormat(1);
    },
    brStateAbbr: function() {
      return Faker.Address.brState(true);
    },
    usStateAbbr: function() {
      return Faker.Address.usState(true);
    },
    pattern: function(pattern) {
      var f, fakerPattern, n;
      fakerPattern = _.flatten((function() {
        var _results;
        _results = [];
        for (n in Faker) {
          _results.push((function() {
            var _results1;
            _results1 = [];
            for (f in Faker[n]) {
              if (f === pattern) {
                _results1.push({
                  func: Faker[n][f],
                  context: Faker[n]
                });
              }
            }
            return _results1;
          })());
        }
        return _results;
      })());
      if (fakerPattern && fakerPattern.length > 0) {
        return fakerPattern[0].func.apply(fakerPattern[0].context);
      } else {
        throw new Error("invalid pattern: " + pattern);
      }
    },
    format: function(format) {
      return Faker.Helpers.replaceSymbolWithNumber(format);
    },
    oneOf: function(items) {
      return Faker.random.array_element(items);
    },
    someOf: function(items, min, max) {
      var candidate, count, excludeCount, excluded, itemsLeft, selected;
      count = min + Faker.Helpers.randomNumber(min - max);
      if (items.length <= count) {
        return items;
      } else {
        excluded = [];
        excludeCount = items.length - count;
        while (excluded.length < excludeCount) {
          itemsLeft = _.without(items, excluded);
          candidate = Faker.random.array_element(itemsLeft);
          excluded.push(candidate);
        }
        return selected = _.without(items, excluded);
      }
    },
    randomInRange: function(min, max) {
      var range;
      range = max - min;
      return min + Math.floor(Math.random() * range);
    },
    weightedSample: function(items) {
      var i, itemMap, seed, total, value, _i, _len;
      itemMap = _.map(items, function(item) {
        var o;
        return o = {
          weight: item[0],
          value: item[1]
        };
      });
      total = _.reduce(itemMap, function(memo, item) {
        item.range = [memo, memo + item.weight - 0.0001];
        return memo + item.weight;
      }, 0);
      seed = Math.random() * total;
      value = null;
      for (_i = 0, _len = itemMap.length; _i < _len; _i++) {
        i = itemMap[_i];
        if (seed >= i.range[0] && seed <= i.range[1]) {
          value = i.value;
          break;
        }
      }
      return value;
    }
  };

  genie = function(template) {
    var arr, c, count, current, i, max, min, obj, places, _i, _ref, _ref1, _ref2, _ref3;
    obj = {};
    for (c in template) {
      current = template[c];
      if (!current.exists || (current != null ? current.exists.apply(obj, [Faker.Genie]) : void 0)) {
        if (_.isFunction(current)) {
          obj[c] = current.apply(obj, [Faker.Genie]);
        } else if (current.template) {
          min = current.min || ((_ref = current.range) != null ? _ref[0] : void 0) || 0;
          max = current.max || ((_ref1 = current.range) != null ? _ref1[1] : void 0) || 5;
          if (!current.min && !current.max) {
            obj[c] = genie(current.template);
          } else {
            count = Faker.Helpers.randomNumber(max - min);
            arr = [];
            for (i = _i = 1; 1 <= count ? _i <= count : _i >= count; i = 1 <= count ? ++_i : --_i) {
              arr.push(genie(current.template));
            }
            obj[c] = arr;
          }
        } else if (current.minAge || current.maxAge) {
{'fraction_non_alphanumeric': 0.14767059968373678, 'fraction_numerical': 0.009366257146332563, 'mean_word_length': 1.8578380257212375, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 9, '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': '2662466', 'n_tokens_mistral': 2626, 'n_tokens_neox': 2566, 'n_words': 578}