<commit_before>// Copyright 2013 <NAME> <<EMAIL>>
// Copyright 2013 The Rust Project Developers
// http://rust-lang.org

// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

/*!
 * Gregorian Calendar module for the datetime library of the Rust programming
 * language
 *
 * Implements a hybrid calendar that supports both the Julian and Gregorian
 * calendar systems.
 *
 * http://en.wikipedia.org/wiki/Gregorian_calendar
 * http://en.wikipedia.org/wiki/Julian_calendar
 */

static YEAR_BASE: int = 1900;
static DAYSPERLYEAR: uint = 366;
static DAYSPERNYEAR: uint = 365;
static DAYSPERWEEK: uint = 7;

pub fn is_leap_year(year: uint) -> bool {
    !(year % 4 != 0) && ((year % 100 != 0) || !(year % 400 != 0))
}

pub fn year_size(year: uint) -> uint {
    if is_leap_year(year) { DAYSPERLYEAR } else { DAYSPERNYEAR }
}


pub struct GCalendar {
    /**
    */
    sec: uint,
    min: uint,
    hour: uint,
    day_of_month: uint,
    month: uint,
    year: uint,
    day_of_week: uint,
    day_of_year: uint
}

impl GCalendar {
    /**
    * Allocates a GCalendar object
    */
    pub fn new_at_epoch() -> GCalendar {
        GCalendar {<commit_msg>gcalendar.rs: less boolean operations in is_leap_year()<commit_after>// Copyright 2013 <NAME> <<EMAIL>>
// Copyright 2013 The Rust Project Developers
// http://rust-lang.org

// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

/*!
 * Gregorian Calendar module for the datetime library of the Rust programming
 * language
 *
 * Implements a hybrid calendar that supports both the Julian and Gregorian
 * calendar systems.
 *
 * http://en.wikipedia.org/wiki/Gregorian_calendar
 * http://en.wikipedia.org/wiki/Julian_calendar
 */

static YEAR_BASE: int = 1900;
static DAYSPERLYEAR: uint = 366;
static DAYSPERNYEAR: uint = 365;
static DAYSPERWEEK: uint = 7;

pub fn is_leap_year(year: uint) -> bool {
    (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0))
}

pub fn year_size(year: uint) -> uint {
    if is_leap_year(year) { DAYSPERLYEAR } else { DAYSPERNYEAR }
}


pub struct GCalendar {
    /**
    */
    sec: uint,
    min: uint,
    hour: uint,
    day_of_month: uint,
    month: uint,
    year: uint,
    day_of_week: uint,
    day_of_year: uint
}

impl GCalendar {
    /**
    * Allocates a GCalendar object
    */
    pub fn new_at_epoch() -> GCalendar {
        GCalendar {
{'fraction_non_alphanumeric': 0.12491178546224418, 'fraction_numerical': 0.02328863796753705, 'mean_word_length': 3.114658925979681, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3257487', 'n_tokens_mistral': 1006, 'n_tokens_neox': 924, 'n_words': 291}