<commit_before>class window.StaffPlan.Models.Assignment extends StaffPlan.Model
  NAME: "assignment"
  initialize: ->
    @work_weeks = new StaffPlan.Collections.WorkWeeks @get("work_weeks"),
      parent: @
    @unset "work_weeks"
    
    @work_weeks.sort()
    
    # When an element is removed from a collection, a "remove" event is triggered
    @bind 'remove', () ->
      @destroy()<commit_msg>Might be useful later.<commit_after>class window.StaffPlan.Models.Assignment extends StaffPlan.Model
  NAME: "assignment"
  initialize: ->
    @work_weeks = new StaffPlan.Collections.WorkWeeks @get("work_weeks"),
      parent: @
    @unset "work_weeks"
    
    @work_weeks.sort()
    
    # When an element is removed from a collection, a "remove" event is triggered
    @bind 'remove', () ->
      @destroy()

   getHoursForPeriod: (begin, end) ->
     date = new XDate()
     # TODO: Port code to fill the gaps from the weekly aggregates
     @work_weeks.select (week) ->
      time = date.setWeek(week.get("cweek"), week.get("year")).getTime()
      time > begin and time < end
{'fraction_non_alphanumeric': 0.12199630314232902, 'fraction_numerical': 0.0, 'mean_word_length': 3.1814671814671813, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 10, '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': '5520422', 'n_tokens_mistral': 342, 'n_tokens_neox': 328, 'n_words': 91}