<commit_before># Determine paths for educators, based on what they have authorization to access.
class PathsForEducator
  def initialize(educator)
    @educator = educator
  end

  # Links shown on the navbar, different depending on role
  def navbar_links
    links = {}
    
    if PerDistrict.new.enabled_class_lists? && ClassListQueries.new(@educator).is_relevant_for_educator?
      links[:classlists] = '/classlists'
    end

    if @educator.districtwide_access?
      links[:district] = url_helpers.educators_districtwide_path
    end

    if @educator.school.present? && (@educator.schoolwide_access? || @educator.has_access_to_grade_levels?) && !@educator.districtwide_access?
      links[:school] = url_helpers.school_path(@educator.school)
    end

    if @educator.school.present? && @educator.schoolwide_access? && !@educator.districtwide_access?
      links[:absences] = url_helpers.absences_school_path(@educator.school)
      links[:tardies] = url_helpers.tardies_school_path(@educator.school)
    end

    if @educator.school.present? && @educator.school.is_high_school? && @educator.sections.size > 0
      links[:section] = url_helpers.section_path(@educator.default_section)
    end

    if @educator.homeroom.present? && !@educator.homeroom.school.is_high_school?
      links[:homeroom] = url_helpers.homeroom_path(@educator.default_homeroom)
    end

    links
  end

  private<commit_msg>Rubocop enforces the law<commit_after># Determine paths for educators, based on what they have authorization to access.
class PathsForEducator
  def initialize(educator)
    @educator = educator
  end

  # Links shown on the navbar, different depending on role
  def navbar_links
    links = {}

    if PerDistrict.new.enabled_class_lists? && ClassListQueries.new(@educator).is_relevant_for_educator?
      links[:classlists] = '/classlists'
    end

    if @educator.districtwide_access?
      links[:district] = url_helpers.educators_districtwide_path
    end

    if @educator.school.present? && (@educator.schoolwide_access? || @educator.has_access_to_grade_levels?) && !@educator.districtwide_access?
      links[:school] = url_helpers.school_path(@educator.school)
    end

    if @educator.school.present? && @educator.schoolwide_access? && !@educator.districtwide_access?
      links[:absences] = url_helpers.absences_school_path(@educator.school)
      links[:tardies] = url_helpers.tardies_school_path(@educator.school)
    end

    if @educator.school.present? && @educator.school.is_high_school? && @educator.sections.size > 0
      links[:section] = url_helpers.section_path(@educator.default_section)
    end

    if @educator.homeroom.present? && !@educator.homeroom.school.is_high_school?
      links[:homeroom] = url_helpers.homeroom_path(@educator.default_homeroom)
    end

    links
  end

  private
{'fraction_non_alphanumeric': 0.10667608618862592, 'fraction_numerical': 0.0007064641469445425, 'mean_word_length': 4.404580152671755, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6619205', 'n_tokens_mistral': 940, 'n_tokens_neox': 904, 'n_words': 156}