<commit_before>module ApplicationHelper
  def champion_icon(name_or_id)
    name = name_or_id.is_a?(Integer) ? Champion.find(name_or_id) : name_or_id.to_s
    image_tag "http://ddragon.leagueoflegends.com/cdn/5.2.1/img/champion/#{name}.png"
  end
end<commit_msg>add helper for generating champion icons<commit_after>module ApplicationHelper
  DATA_DRAGON_VERSION = '5.7.2'

  def champion_icon(champion)
    name = case champion
    when Integer
      Champion.find(champion).key
    when String
      champion
    when Champion
      champion.key
    end

    image_tag "http://ddragon.leagueoflegends.com/cdn/#{DATA_DRAGON_VERSION}/img/champion/#{name}.png"
  end
end
{'fraction_non_alphanumeric': 0.1031390134529148, 'fraction_numerical': 0.008968609865470852, 'mean_word_length': 3.926470588235294, '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': '1535668', 'n_tokens_mistral': 238, 'n_tokens_neox': 241, 'n_words': 39}