<commit_before>class Calendar
  include ViewHelpers

  # <tt>:month</tt> <Integer>:: the month for the calendar
  # <tt>:year</tt> <Integer>:: the year for the calendar
  # <tt>:days</tt> <Hash>:: the days for the calendar, including scheduled events
  attr_reader :month, :year, :days

  def initialize(options={})
    @month  = options[:month]  || Time.now.month
    @year   = options[:year]   || Time.now.year
    @events = options[:events] || []
    @page   = Time.utc(@year, @month)
    @days   = Hash.new

    days_in_month.times { |i| @days[i] = { :events => [] } }
  end

  alias_method :day, :days
  
  def starts_on
    Time.utc(@page.year, @page.month, 1).wday
  end
  
  def ends_on
    Time.utc(@page.year, @page.month, days_in_month).wday
  end
  
  def add(event_objects, options={})
    raise ArgumentError, "Must specify :schedule_for attribute to assign events to days." unless options[:schedule_for]
    options[:html_class] ||= options[:schedule_for]
    event_objects.each do |event|
      schedule_for = event.send(options[:schedule_for])
      if schedule_for && schedule_for.month == @page.month && schedule_for.year == @page.year
        @events << options[:html_class] unless @events.include?(options[:html_class])
        @days[schedule_for.day][:events] << options[:html_class]
      end
    end
  end
  
  def generate(options={})
    options[:header_length] ||= 1
    options[:ignore_today]  ||= false
    build options
  end<commit_msg>Clean up starts_on<commit_after>class Calendar
  include ViewHelpers

  # <tt>:month</tt> <Integer>:: the month for the calendar
  # <tt>:year</tt> <Integer>:: the year for the calendar
  # <tt>:days</tt> <Hash>:: the days for the calendar, including scheduled events
  attr_reader :month, :year, :days

  def initialize(options={})
    @month  = options[:month]  || Time.now.month
    @year   = options[:year]   || Time.now.year
    @events = options[:events] || []
    @page   = Time.utc(@year, @month)
    @days   = Hash.new

    days_in_month.times { |i| @days[i] = { :events => [] } }
  end

  alias_method :day, :days
  
  # The week day number the calendar starts on
  #
  # ==== Returns
  # Integer
  def starts_on
    @page.wday
  end
  
  def ends_on
    Time.utc(@page.year, @page.month, days_in_month).wday
  end
  
  def add(event_objects, options={})
    raise ArgumentError, "Must specify :schedule_for attribute to assign events to days." unless options[:schedule_for]
    options[:html_class] ||= options[:schedule_for]
    event_objects.each do |event|
      schedule_for = event.send(options[:schedule_for])
      if schedule_for && schedule_for.month == @page.month && schedule_for.year == @page.year
        @events << options[:html_class] unless @events.include?(options[:html_class])
        @days[schedule_for.day][:events] << options[:html_class]
      end
    end
  end
  
  def generate(options={})
    options[:header_length] ||= 1
    options[:ignore_today]  ||= false
    build options
  end
{'fraction_non_alphanumeric': 0.14323962516733602, 'fraction_numerical': 0.001004016064257028, 'mean_word_length': 3.4947368421052634, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 23, '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': '6621226', 'n_tokens_mistral': 979, 'n_tokens_neox': 967, 'n_words': 237}