<commit_before>/* jshint esversion: 6 */

let BUTTON_CHECKED = 'goog-imageless-button-checked'
let BUTTON_CONTENT = 'goog-imageless-button-content'

function trigger(event_names, elem) {
    // event_names: space sep names of events
    // elem: jQuery element
    if (!event_names || event_names.length === 0) {
        throw (`Cannot trigger ${event_names}, element event_names`)
    }
    if (!elem || elem.length === 0) {
        throw (`Cannot trigger ${event_names}, element missing`)
    }
    for (let event_name of event_names.split(' ')) {
        let evt = document.createEvent("MouseEvents")
        // eek, there's gotta be a better way.
        // replace with https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent
        // https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events
        evt.initMouseEvent(event_name, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null)
        let dom_elem = elem.get(0)
        dom_elem.dispatchEvent(evt)
    }
    return elem
}


class Toolbar {
    get buttons() {
        return $('#topRightNavigation .goog-imageless-button')
    }
    get month_view() {
        return this.buttons.eq(2)
    }
    get custom_view() {
        return this.buttons.eq(3)
    }
    get prev_month() {
        return $('.navBack').eq(0)
    }
    get today() {
        return $('#todayButton\\:1,#todayButton\\:2').children().eq(0)
    }
    get next_month() {
        return $('#dp_0_next')
    }
    get is_custom_view_active() {
        return this.custom_view.is(`.${BUTTON_CHECKED}`)
    }

    poll_custom_button_visibility(wait_ms = 500) {
        if (
            this.custom_view.is(":visible") &&<commit_msg>remove unused code, fixes #1<commit_after>/* jshint esversion: 6 */

let BUTTON_CHECKED = 'goog-imageless-button-checked'
let BUTTON_CONTENT = 'goog-imageless-button-content'

function trigger(event_names, elem) {
    // event_names: space sep names of events
    // elem: jQuery element
    if (!event_names || event_names.length === 0) {
        throw (`Cannot trigger ${event_names}, element event_names`)
    }
    if (!elem || elem.length === 0) {
        throw (`Cannot trigger ${event_names}, element missing`)
    }
    for (let event_name of event_names.split(' ')) {
        let evt = document.createEvent("MouseEvents")
        // eek, there's gotta be a better way.
        // replace with https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent
        // https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events
        evt.initMouseEvent(event_name, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null)
        let dom_elem = elem.get(0)
        dom_elem.dispatchEvent(evt)
    }
    return elem
}


class Toolbar {
    get buttons() {
        return $('#topRightNavigation .goog-imageless-button')
    }
    get month_view() {
        return this.buttons.eq(2)
    }
    get custom_view() {
        return this.buttons.eq(3)
    }
    get is_custom_view_active() {
        return this.custom_view.is(`.${BUTTON_CHECKED}`)
    }

    poll_custom_button_visibility(wait_ms = 500) {
        if (
            this.custom_view.is(":visible") &&
{'fraction_non_alphanumeric': 0.1377079482439926, 'fraction_numerical': 0.011090573012939002, 'mean_word_length': 2.6855845629965946, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '5070483', 'n_tokens_mistral': 1082, 'n_tokens_neox': 1030, 'n_words': 232}