You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: student_enrollments_list.rb
    path of file: ./repos/i-diario/app/services
    
    the code of the file until where you have to start completion: class StudentEnrollmentsList
  SEARCH_TYPES = [
    :by_date, :by_date_range
  ].freeze

  def initialize(params)
    @classroom = params.fetch(:classroom)
    @grade = params.fetch(:grade, nil)
    @discipline = params.fetch(:discipline)
    @date = params.fetch(:date, nil)
    @year = params.fetch(:year, nil)
    @start_at = params.fetch(:start_at, nil)
    @end_at = params.fetch(:end_at, nil)
    @search_type = params.fetch(:search_type, :by_date)
    @show_inactive = params.fetch(:show_inactive, true)
    @show_inactive_outside_step = params.fetch(:show_inactive_outside_step, true)
    @score_type = param
    
  def reject_duplicated_students(student_enrollments)
    unique_student_enrollments = []
    student_enrollments.each do |student_enrollment|
      student_enrollments_for_student = student_enrollments.by_student(student_enrollment.student_id).active

      if student_enrollments_for_student.count > 1
        any_active_enrollment = false
        student_enrollments_for_student.each do |student_enrollment_for_student|
          if student_active?(student_enrollment_for_student)
            unique_student_enrollments << student_enrollment_for_student
            any_active_enrollment = true
            break
          end
        end

        if !any_active_enrollment
          unique_student_enrollments << student_enrollments_for_student.show_as_inactive.first
        end