<commit_before># container for all the reserves for a course id
Course = Struct.new( :reserves, :id) do
# generally, we don't want to include the deletions... (Except the Librarian Request deletion)
  def initialize(id)
    self.id = id
    rep = Rlist.new.list(id)
    input_list = JSON.parse(rep.body)
    self.reserves  = input_list.collect {|request|  Reserve.new(request)}
  end
  def list
    no_deletes
    if self.ins_sortable?
      self.reserves.sort_by! {|res| Integer(res.instructor_sort_order || "0") }
    end
    self.reserves
  end
  def student_list
    no_deletes
    visible_only
    no_new
    if self.ins_sortable?
      self.reserves.sort_by! {|res| Integer(res.instructor_sort_order || "0") }
    end
    self.reserves
  end
  def no_deletes
       self.reserves = self.reserves.reject {|request| request.status.start_with?("DR_") }
  end
  def visible_only
    self.reserves = self.reserves.reject {|request| request.visibility == "R" }
  end
  def no_new
    self.reserves = self.reserves.reject {|request| request.display_status == "New" }<commit_msg>sort on author if no instructor sort order<commit_after># container for all the reserves for a course id
Course = Struct.new( :reserves, :id) do
# generally, we don't want to include the deletions... (Except the Librarian Request deletion)
  def initialize(id)
    self.id = id
    rep = Rlist.new.list(id)
    input_list = JSON.parse(rep.body)
    self.reserves  = input_list.collect {|request|  Reserve.new(request)}
  end
  def list
    no_deletes
    if self.ins_sortable?
      self.reserves.sort_by! {|res| Integer(res.instructor_sort_order || "0") }
    end
    self.author_sort
  end
  def student_list
    no_deletes
    visible_only
    no_new
    if self.ins_sortable?
      self.reserves.sort_by! {|res| Integer(res.instructor_sort_order || "0") }
    end
    self.reserves
  end
  def author_sort
    self.reserves.sort_by! {|res| (res.author || "") }
  end
  def no_deletes
       self.reserves = self.reserves.reject {|request| request.status.start_with?("DR_") }
  end
  def visible_only
    self.reserves = self.reserves.reject {|request| request.visibility == "R" }
  end
  def no_new
    self.reserves = self.reserves.reject {|request| request.display_status == "New" }
{'fraction_non_alphanumeric': 0.11037527593818984, 'fraction_numerical': 0.0017660044150110375, 'mean_word_length': 3.3244274809160306, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '767870', 'n_tokens_mistral': 790, 'n_tokens_neox': 773, 'n_words': 191}