<commit_before>(function($) {

  $.fn.focusBegin = function(){
    var element = this[0];

    if (this.is('textarea')) { 
        element.focus(); 
        element.setSelectionRange(0, 0); 
      } else if (this.is('input')) { 
        var range = element.createTextRange();  
        range.moveStart('character', 0); 
        range.select();
      } else {
        var range = document.createRange();   
        range.selectNodeContents(element);    
        range.collapse(true);         
        var selection = window.getSelection();  
        selection.removeAllRanges();        
        selection.addRange(range);
      }
  };
  
  $.fn.focusEnd = function(){
    var element = this[0];

    if (this.is('textarea')) { 
        element.focus();
        element.setSelectionRange(this.val().length, this.val().length); 
      } else if (this.is('input')) { 
        var range = element.createTextRange();  
        range.moveStart('character', this.val().length); 
        range.select();
      } else {
        var range = document.createRange();   
        range.selectNodeContents(element);    
        range.collapse(false);          
        var selection = window.getSelection();  
        selection.removeAllRanges();        
        selection.addRange(range);        
      }
  };

})(jQuery);<commit_msg>Update jquery.focus.js<commit_after>(function($) {

  $.fn.focusBegin = function() {
    var element = this[0];

    if (this.is('textarea')) { 
      element.focus(); 
      element.setSelectionRange(0, 0); 
    } else if (this.is('input')) { 
      var range = element.createTextRange();  
      range.moveStart('character', 0); 
      range.select();
    } else {
      var range = document.createRange();   
      range.selectNodeContents(element);    
      range.collapse(true);         
      var selection = window.getSelection();  
      selection.removeAllRanges();        
      selection.addRange(range);
    }
  };
  
  $.fn.focusEnd = function() {
    var element = this[0];

    if (this.is('textarea')) { 
      element.focus();
      element.setSelectionRange(this.val().length, this.val().length); 
    } else if (this.is('input')) { 
      var range = element.createTextRange();  
      range.moveStart('character', this.val().length); 
      range.select();
    } else {
      var range = document.createRange();   
      range.selectNodeContents(element);    
      range.collapse(false);          
      var selection = window.getSelection();  
      selection.removeAllRanges();        
      selection.addRange(range);  
    }      
  };

})(jQuery);
{'fraction_non_alphanumeric': 0.14963362900115695, 'fraction_numerical': 0.0038565368299267257, 'mean_word_length': 2.132850241545894, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3905652', 'n_tokens_mistral': 756, 'n_tokens_neox': 720, 'n_words': 124}