<commit_before>/**
 * Idle timer
 * @module idletimer
 */
YUI.add("idle-timer", function(Y){

    //-------------------------------------------------------------------------
    // Private variables
    //-------------------------------------------------------------------------
    
    var idle    = false,        //indicates if the user is idle
        tId     = -1,           //timeout ID
        enabled  = false,        //indicates if the idle timer is enabled
        timeout = 30000;        //the amount of time (ms) before the user is considered idle

    //-------------------------------------------------------------------------
    // Private functions
    //-------------------------------------------------------------------------
        
    /** (intentionally not document)
     * Handles a user event indicating that the user isn't idle.
     * @param {Event} event A DOM2-normalized event object.
     * @return {void}
     */
    function handleUserEvent(){
    
        //clear any existing timeout
        clearTimeout(tId);
        
        //if the idle timer is enabled
        if (enabled){
        
            //if it's idle, that means the user is no longer idle
            if (idle){
                toggleIdleState();           
            } else {
                //set a new timeout
                tId = setTimeout(toggleIdleState, timeout);
            }
        }    
    }
    
    function toggleIdleState(){
    
        //toggle the state
        idle = !idle;
        
        //fire appropriate event
        Y.IdleTimer.fire(idle ? "idle" : "active");            
    }

    //-------------------------------------------------------------------------
    // Public interface
    //-------------------------------------------------------------------------<commit_msg>Documentation changes<commit_after>/**
 * Idle timer
 * @module idletimer
 */
YUI.add("idle-timer", function(Y){

    //-------------------------------------------------------------------------
    // Private variables
    //-------------------------------------------------------------------------
    
    var idle    = false,        //indicates if the user is idle
        tId     = -1,           //timeout ID
        enabled = false,        //indicates if the idle timer is enabled
        timeout = 30000;        //the amount of time (ms) before the user is considered idle

    //-------------------------------------------------------------------------
    // Private functions
    //-------------------------------------------------------------------------
        
    /* (intentionally not documented)
     * Handles a user event indicating that the user isn't idle.
     * @param {Event} event A DOM2-normalized event object.
     * @return {void}
     */
    function handleUserEvent(){
    
        //clear any existing timeout
        clearTimeout(tId);
        
        //if the idle timer is enabled
        if (enabled){
        
            //if it's idle, that means the user is no longer idle
            if (idle){
                toggleIdleState();           
            } else {
                //set a new timeout
                tId = setTimeout(toggleIdleState, timeout);
            }
        }    
    }
    
    /* (intentionally not documented)
     * Toggles the idle state and fires an appropriate event.
     * @return {void}
     */
    function toggleIdleState(){
    
        //toggle the state
        idle = !idle;
        
        //fire appropriate event
        Y.IdleTimer.fire(idle ? "idle" : "active");            
    }

    //-------------------------------------------------------------------------
    // Public interface
    //-------------------------------------------------------------------------
{'fraction_non_alphanumeric': 0.30701754385964913, 'fraction_numerical': 0.003721424774056353, 'mean_word_length': 0.7775153519130845, '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': '2065626', 'n_tokens_mistral': 800, 'n_tokens_neox': 789, 'n_words': 255}