<commit_before>class Profile

  def initialize(user, current_user=user)
    @user = user
    @current_user = current_user
  end

  def username
    user.username
  end

  def has_current_submissions?
    user.submissions.pending.count > 0
  end

  def has_completed_submissions?
    user.submissions.done.count > 0
  end

  def teams
    user.teams | user.teams_created
  end

  def has_teams?
    teams.any?
  end

  def has_nitpicked?
    user.comments.any?
  end

  def nitpicks
    user.comments
  end

  def current
    user.active_submissions
  end

  def completed_in(language)
    user.completed_submissions_in(language)
  end

  def languages
    user.worked_in_languages
  end

  def github_link
    %{<a target="_blank" href="https://github.com/#{user.username}">#{user.username}</a>}
  end

  def submission_link(submission)
   %{<a href="/submissions/#{submission.key}">#{submission.name}</a>}
  end

  def no_current_sumbissions_message
    if narcissistic?<commit_msg>Do not link to exercises that you have not completed<commit_after>class Profile

  def initialize(user, current_user=user)
    @user = user
    @current_user = current_user
  end

  def username
    user.username
  end

  def has_current_submissions?
    user.submissions.pending.count > 0
  end

  def has_completed_submissions?
    user.submissions.done.count > 0
  end

  def teams
    user.teams | user.teams_created
  end

  def has_teams?
    teams.any?
  end

  def has_nitpicked?
    user.comments.any?
  end

  def nitpicks
    user.comments
  end

  def current
    user.active_submissions
  end

  def completed_in(language)
    user.completed_submissions_in(language).reverse
  end

  def languages
    user.worked_in_languages
  end

  def github_link
    %{<a target="_blank" href="https://github.com/#{user.username}">#{user.username}</a>}
  end

  def submission_link(submission)
    if narcissistic? || current_user.nitpicker_on?(submission.exercise)
     %{<a href="/submissions/#{submission.key}">#{submission.name}</a>}
    else
     %{<a href="/exercises/#{submission.slug}">#{submission.name}</a>}
    end
  end

  def no_current_sumbissions_message
    if narcissistic?
{'fraction_non_alphanumeric': 0.09747126436781609, 'fraction_numerical': 0.0018390804597701149, 'mean_word_length': 3.3607214428857715, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 2, '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': '6692836', 'n_tokens_mistral': 789, 'n_tokens_neox': 736, 'n_words': 151}