<commit_before>var imageTagBuilder = function() {

  var that = {};
  var attributeWidth;

  that.innerWidth = window.innerWidth;
  that.innerHeight = window.innerHeight;
  that.dpr = window.devicePixelRatio;

  that.attributeHeight = function() {
    return parseInt( attributeWidth * that.sourceHeight / that.sourceWidth , 10);
  };

  that.attributeWidth = function() {
  	return attributeWidth;
  };

  that.callHeight= function() {
    return that.attributeHeight() * that.dpr;
  };
  
  that.callWidth = function() {
    return that.attributeWidth() * that.dpr;
  };
  
  that.imageTag = function() {
    return '<img alt="some horses" class="basic" width="' + that.attributeWidth() + '" height="' + that.attributeHeight() + '" src="http://res.cloudinary.com/demo/image/upload/c_fill,q_85,w_' + that.callWidth() + ',h_' + that.callHeight() +'/horses.jpg">';
  };

  that.prep = function(params) {
  	that.sourceWidth = params["sourceWidth"];
  	that.sourceHeight = params["sourceHeight"];
  };

  that.requestHeightViaPercentage = function(pct) {
    that.setAttributeWidth(that.innerHeight * pct / 100 * that.sourceWidth / that.sourceHeight);
  };

  that.requestWidthViaPercentage = function(pct) {
    that.setAttributeWidth(that.innerWidth * pct / 100);
  };

  that.requestWidthViaPixels = function(width) {
  	that.setAttributeWidth(width);
  };

  that.setAttributeWidth= function(width) {
    attributeWidth = parseInt(Math.min(width, (that.sourceWidth / that.dpr), that.innerWidth), 10);
  };
  
  return that;

};
<commit_msg>Using "o" instead of "that" for the main object to save a little space.<commit_after>var imageTagBuilder = function() {

  var o = {};
  var attributeWidth;

  o.innerWidth = window.innerWidth;
  o.innerHeight = window.innerHeight;
  o.dpr = window.devicePixelRatio;

  o.attributeHeight = function() {
    return parseInt( attributeWidth * o.sourceHeight / o.sourceWidth , 10);
  };

  o.attributeWidth = function() {
  	return attributeWidth;
  };

  o.callHeight= function() {
    return o.attributeHeight() * o.dpr;
  };
  
  o.callWidth = function() {
    return o.attributeWidth() * o.dpr;
  };
  
  o.imageTag = function() {
    return '<img alt="some horses" class="basic" width="' + o.attributeWidth() + '" height="' + o.attributeHeight() + '" src="http://res.cloudinary.com/demo/image/upload/c_fill,q_85,w_' + o.callWidth() + ',h_' + o.callHeight() +'/horses.jpg">';
  };

  o.prep = function(params) {
  	o.sourceWidth = params["sourceWidth"];
  	o.sourceHeight = params["sourceHeight"];
  };

  o.requestHeightViaPercentage = function(pct) {
    o.setAttributeWidth(o.innerHeight * pct / 100 * o.sourceWidth / o.sourceHeight);
  };

  o.requestWidthViaPercentage = function(pct) {
    o.setAttributeWidth(o.innerWidth * pct / 100);
  };

  o.requestWidthViaPixels = function(width) {
  	o.setAttributeWidth(width);
  };

  o.setAttributeWidth= function(width) {
    attributeWidth = parseInt(Math.min(width, (o.sourceWidth / o.dpr), o.innerWidth), 10);
  };
  
  return o;

};

{'fraction_non_alphanumeric': 0.15473441108545036, 'fraction_numerical': 0.00791817881887166, 'mean_word_length': 3.805071315372425, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7564045', 'n_tokens_mistral': 1042, 'n_tokens_neox': 1001, 'n_words': 177}