<commit_before>module Helpers
  def partial(template, locals = {})
    slim template, :layout => false, :locals => locals
  end

  def find_template(views, name, engine, &block)
    views.each { |v| super(v, name, engine, &block) }
  end

  def user_pass
    user = Nutzer.where(:US_LoginName => request.env["REMOTE_USER"]).first
    return "" if user.nil?
    user.login+":"+Nutzer.crypt(user.password)
  end

  def dokumente(repos, fachklasse, abschnitt)
    ary = repos.select{|r|r.enabled?}.map do |repo|
      docs = repo.documents.select do |d|
        (d.get("Ignoriere-Abschnitt") != abschnitt) && (d.verfuegbar(fachklasse))
      end
      next if docs.empty?
      docs.sort_by!{|d|d.get "Name"}
      [repo.repo_name, docs]
    end
    ary.compact.to_h
  end

  def restart
    puts "Server neu starten …"
    File.open("./tmp/restart.txt", "w"){}
  end
end

<commit_msg>object anstelle von class<commit_after>module Helpers
  def partial(template, locals = {})
    slim template, :layout => false, :locals => locals
  end

  def find_template(views, name, engine, &block)
    views.each { |v| super(v, name, engine, &block) }
  end

  def user_pass
    user = Nutzer.where(:US_LoginName => request.env["REMOTE_USER"]).first
    return "" if user.nil?
    user.login+":"+user.crypt(user.password)
  end

  def dokumente(repos, fachklasse, abschnitt)
    ary = repos.select{|r|r.enabled?}.map do |repo|
      docs = repo.documents.select do |d|
        (d.get("Ignoriere-Abschnitt") != abschnitt) && (d.verfuegbar(fachklasse))
      end
      next if docs.empty?
      docs.sort_by!{|d|d.get "Name"}
      [repo.repo_name, docs]
    end
    ary.compact.to_h
  end

  def restart
    puts "Server neu starten …"
    File.open("./tmp/restart.txt", "w"){}
  end
end


{'fraction_non_alphanumeric': 0.1488162344983089, 'fraction_numerical': 0.0, 'mean_word_length': 3.1087962962962963, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 9, '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': '1821279', 'n_tokens_mistral': 674, 'n_tokens_neox': 648, 'n_words': 145}