<commit_before>App.controller('CalendarController', function ($timeout, $scope, Utils, GenerativeJobQueue) {

    var INITIAL_MONTHS_SHOWN = 15;
    var WEEKS_OFFSET = 2;

    // This object holds the external api for the calendar, i.e. function that other components outside
    // calendar can call to manipulate the calendar from the outside
    $scope.api = {};

    $scope.calendar = [];

    var baseCellClasses = function(day, week) {
        return {
            'empty': !day.content,
            'even': day.date.getMonth() % 2 == 0,
            'odd': day.date.getMonth() % 2 == 1,
            'today': day.date.isToday(),
            'selected': day.selected
        };
    };

    $scope.cellClass = function(day, week) {
        var classes = baseCellClasses(day, week);
        if ($scope.providedCellClass != null) {
            _.extend(classes, $scope.providedCellClass({day: day, week: week}));
        }
        return classes;
    };

    var firstDay = Date.firstDayOfThisMonth().lastSunday();
    var lastDay = firstDay.clone();
    var loadedWeeks = [];
    var pendingWeeks = [];

    var cellHeight = null;

    function getCellHeight() {
        if (cellHeight === null) {
            var h = $(".week").outerHeight();
            if (h > 0) {
                // +4 from border-spacing, TODO refactor
                cellHeight = h + 4;
            }
        }
        return cellHeight;
    }

    function computeNumberOfWeeks(firstDay) {
        // Get first day of the next month
        var lastDay = firstDay.plusDays(27);
        while (lastDay.getDate() != 1) {
            lastDay = lastDay.next();
        }
        lastDay = lastDay.lastSunday();
        var days = Date.differenceInDays(firstDay, lastDay);
        return Math.ceil(days / 7.0);
    }

    function createMonth(day, nweeks) {
        return {
            number: day.getMonth(),
            name: day.getMonthName(),
            year: day.getFullYear(),<commit_msg>[fix] Fix today button on resized screen<commit_after>App.controller('CalendarController', function ($timeout, $scope, Utils, GenerativeJobQueue) {

    var INITIAL_MONTHS_SHOWN = 15;
    var WEEKS_OFFSET = 2;

    // This object holds the external api for the calendar, i.e. function that other components outside
    // calendar can call to manipulate the calendar from the outside
    $scope.api = {};

    $scope.calendar = [];

    var baseCellClasses = function(day, week) {
        return {
            'empty': !day.content,
            'even': day.date.getMonth() % 2 == 0,
            'odd': day.date.getMonth() % 2 == 1,
            'today': day.date.isToday(),
            'selected': day.selected
        };
    };

    $scope.cellClass = function(day, week) {
        var classes = baseCellClasses(day, week);
        if ($scope.providedCellClass != null) {
            _.extend(classes, $scope.providedCellClass({day: day, week: week}));
        }
        return classes;
    };

    var firstDay = Date.firstDayOfThisMonth().lastSunday();
    var lastDay = firstDay.clone();
    var loadedWeeks = [];
    var pendingWeeks = [];

    var weekElements = null;

    function getCellHeight() {
        if (weekElements == null) {
            weekElements = $(".week");
        }
        var h = weekElements.outerHeight();
        if (h == null || h <= 0) {
            weekElements = null;
            return null;
        } else {
            return h + 4;
        }
    }

    function computeNumberOfWeeks(firstDay) {
        // Get first day of the next month
        var lastDay = firstDay.plusDays(27);
        while (lastDay.getDate() != 1) {
            lastDay = lastDay.next();
        }
        lastDay = lastDay.lastSunday();
        var days = Date.differenceInDays(firstDay, lastDay);
        return Math.ceil(days / 7.0);
    }

    function createMonth(day, nweeks) {
        return {
            number: day.getMonth(),
            name: day.getMonthName(),
            year: day.getFullYear(),
{'fraction_non_alphanumeric': 0.12518778167250877, 'fraction_numerical': 0.007260891337005508, 'mean_word_length': 2.0082831325301207, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '2369147', 'n_tokens_mistral': 1199, 'n_tokens_neox': 1122, 'n_words': 297}