<commit_before>module UsersHelper

  def show_private_message?
    if cookies[:identity] == params[:username] && (cookies[:show_private_message] ||= 1).to_i <= 2
      cookies[:show_private_message] = cookies[:show_private_message].to_i + 1
      true
    else
      false
    end
  end

  def avatar_image_tag(user, options = {})
    options['data-user'] = user.username
    link_to(
        users_image_tag(user),
        badge_path(username: user.username), options
    )
  end

  def users_team_image_tag(user, options = {})
    return image_tag(user.team_avatar, options) unless user.team_avatar.blank?
    users_image_tag(user, options)
  end

  def users_image_tag(user, options = {})
    options[:class] ||= 'avatar'
    options[:alt] ||= user.username
    image_tag(users_image_path(user), options)
  end

  #TODO Remove
  def users_image_path(user)
    return ''
    user.avatar.url
  end

  def user_or_team_image_path(user_or_team)
    user_or_team.is_a?(User) ? users_image_path(user_or_team) : user_or_team.avatar_url
  end

  def remaining_bookmarks(user)
    bookmarks = []
    if user.linkedin_token.blank?
      bookmarks << social_bookmark('linkedin', link_linkedin_path, 'Link your LinkedIn account', 'needtolink')
    end
    if user.twitter_token.blank?
      bookmarks << social_bookmark('twitter', link_twitter_path, 'Link your Twitter account', 'needtolink')
    end
    if user.github.blank?
      bookmarks << social_bookmark('github', link_github_path, 'Link your GitHub account', 'needtolink')
    end
    bookmarks
  end

  def social_bookmarks(user)
    bookmarks = []
    bookmarks << social_bookmark('github', "https://github.com/" + user.github) unless user.github.blank?
    if viewing_self?
      bookmarks << social_bookmark('linkedin', linkedin_url(user)) unless user.linkedin_token.blank?
      bookmarks << social_bookmark('twitter', "https://twitter.com/" + user.twitter, "@#{user.twitter}") unless user.twitter_token.blank?<commit_msg>Show the user's avatar url<commit_after>module UsersHelper

  def show_private_message?
    if cookies[:identity] == params[:username] && (cookies[:show_private_message] ||= 1).to_i <= 2
      cookies[:show_private_message] = cookies[:show_private_message].to_i + 1
      true
    else
      false
    end
  end

  def avatar_image_tag(user, options = {})
    options['data-user'] = user.username
    link_to(
        users_image_tag(user),
        badge_path(username: user.username), options
    )
  end

  def users_team_image_tag(user, options = {})
    return image_tag(user.team_avatar, options) unless user.team_avatar.blank?
    users_image_tag(user, options)
  end

  def users_image_tag(user, options = {})
    options[:class] ||= 'avatar'
    options[:alt] ||= user.username
    image_tag(users_image_path(user), options)
  end

  #TODO Remove
  def users_image_path(user)
    user.avatar.url
  end

  def user_or_team_image_path(user_or_team)
    user_or_team.is_a?(User) ? users_image_path(user_or_team) : user_or_team.avatar_url
  end

  def remaining_bookmarks(user)
    bookmarks = []
    if user.linkedin_token.blank?
      bookmarks << social_bookmark('linkedin', link_linkedin_path, 'Link your LinkedIn account', 'needtolink')
    end
    if user.twitter_token.blank?
      bookmarks << social_bookmark('twitter', link_twitter_path, 'Link your Twitter account', 'needtolink')
    end
    if user.github.blank?
      bookmarks << social_bookmark('github', link_github_path, 'Link your GitHub account', 'needtolink')
    end
    bookmarks
  end

  def social_bookmarks(user)
    bookmarks = []
    bookmarks << social_bookmark('github', "https://github.com/" + user.github) unless user.github.blank?
    if viewing_self?
      bookmarks << social_bookmark('linkedin', linkedin_url(user)) unless user.linkedin_token.blank?
      bookmarks << social_bookmark('twitter', "https://twitter.com/" + user.twitter, "@#{user.twitter}") unless user.twitter_token.blank?
{'fraction_non_alphanumeric': 0.11813812294459904, 'fraction_numerical': 0.0015178345560333923, 'mean_word_length': 4.024142312579415, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '4709410', 'n_tokens_mistral': 1300, 'n_tokens_neox': 1283, 'n_words': 250}