<commit_before>class PlatformsController < ApplicationController
  before_action :find_platform, :only => [:show, :legacy]

  def index
    @platforms = Download.platforms
  end

  def show
    @licenses = Project.platform(@platform_name).popular_licenses.limit(8).to_a
    @updated = Project.platform(@platform_name).limit(5).order('updated_at DESC')
    @created = Project.platform(@platform_name).limit(5).order('created_at DESC')
    @popular = Project.platform(@platform_name).with_repo.limit(5).order('github_repositories.stargazers_count DESC')
    @contributors = GithubUser.top_for(@platform_name, 5)
  end

  def legacy
    redirect_to platform_path(@platform_name.downcase), :status => :moved_permanently<commit_msg>Popular projects by uniq github repos<commit_after>class PlatformsController < ApplicationController
  before_action :find_platform, :only => [:show, :legacy]

  def index
    @platforms = Download.platforms
  end

  def show
    @licenses = Project.platform(@platform_name).popular_licenses.limit(8).to_a
    @updated = Project.platform(@platform_name).limit(5).order('updated_at DESC')
    @created = Project.platform(@platform_name).limit(5).order('created_at DESC')
    @contributors = GithubUser.top_for(@platform_name, 5)
    @popular = Project.platform(@platform_name).with_repo.limit(20)
      .order('github_repositories.stargazers_count DESC')
      .to_a.uniq(&:github_repository_id).first(5)
  end

  def legacy
    redirect_to platform_path(@platform_name.downcase), :status => :moved_permanently
{'fraction_non_alphanumeric': 0.12044270833333333, 'fraction_numerical': 0.0078125, 'mean_word_length': 5.5965665236051505, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5614595', 'n_tokens_mistral': 493, 'n_tokens_neox': 473, 'n_words': 78}