<commit_before>package plugins;

import com.google.common.base.Strings;
import models.Difficulty;
import models.Mode;
import models.Score;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.List;

import static java.awt.Color.*;
import static java.awt.Font.BOLD;
import static java.awt.Font.PLAIN;
import static java.awt.RenderingHints.*;
import static java.awt.image.BufferedImage.TYPE_INT_ARGB;
import static org.apache.commons.lang3.StringUtils.leftPad;
import static org.apache.commons.lang3.StringUtils.rightPad;

public class RankingDrawer {

    interface PictureLine {
        void draw(Graphics2D graphics, int y);
    }

    private static final int fontHeight = 12;

    private final static Font normalFont = new Font("Courier", PLAIN, 14);
    private final static Font parameterFont = new Font("Courier", BOLD, 14);
    private final static Font gameFont = new Font("Verdana", BOLD, 12);
    private final static Font playerFont = new Font("Courier", BOLD, 12);
    private final static Font scoreFont = new Font("Courier", BOLD, 14);

    public static class GameLine implements PictureLine {

        private final Mode mode;
        private final Difficulty difficulty;

        public GameLine(Mode mode, Difficulty difficulty) {
            this.mode = mode;
            this.difficulty = difficulty;
        }

        @Override
        public void draw(Graphics2D graphics, int y) {
            graphics.setColor(RED);
            graphics.setFont(gameFont);
            graphics.drawString((mode == null ? "" : mode) + " " + (difficulty == null ? "" : difficulty), 30, y);
        }
    }

    public static class ScoreLine implements PictureLine {

        private final models.Score score;

        public ScoreLine(Score score) {
            this.score = score;
        }

        @Override
        public void draw(Graphics2D graphics, int y) {
            graphics.setColor(DARK_GRAY);
            graphics.setFont(normalFont);
            String rank = leftPad(score.rank() + ".", 3);
            String player = score.player.name;
            graphics.drawString(rank, 0, y);

            graphics.setFont(playerFont);
            graphics.drawString(player, 30, y);

            graphics.setColor(BLUE);
            graphics.setFont(scoreFont);
            graphics.drawString(Strings.padStart(score.formattedValue(), Long.valueOf(Long.MAX_VALUE).toString().length() + 6, ' '), 200, y);


            graphics.setColor(DARK_GRAY);
            graphics.setFont(parameterFont);
            String platform = score.platform == null ? "" : leftPad(score.platform.name, 12);
            if (score.game.platforms.isEmpty() || score.game.platforms.size() == 1) {
                platform = "";
            }
            String stage = score.stage == null ? "" : rightPad(score.stage.toString(), 12);
            graphics.drawString(stage + " " + platform, 420, y);
        }
    }

    public static class BreakLine implements PictureLine {

        @Override<commit_msg>Affiche les commentaires dans l image du ranking<commit_after>package plugins;

import com.google.common.base.Strings;
import models.Difficulty;
import models.Mode;
import models.Score;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.List;

import static java.awt.Color.*;
import static java.awt.Font.BOLD;
import static java.awt.Font.PLAIN;
import static java.awt.RenderingHints.*;
import static java.awt.image.BufferedImage.TYPE_INT_ARGB;
import static org.apache.commons.lang3.StringUtils.leftPad;
import static org.apache.commons.lang3.StringUtils.rightPad;

public class RankingDrawer {

    interface PictureLine {
        void draw(Graphics2D graphics, int y);
    }

    private static final int fontHeight = 12;

    private final static Font normalFont = new Font("Courier", PLAIN, 14);
    private final static Font parameterFont = new Font("Courier", BOLD, 14);
    private final static Font gameFont = new Font("Verdana", BOLD, 12);
    private final static Font playerFont = new Font("Courier", BOLD, 12);
    private final static Font scoreFont = new Font("Courier", BOLD, 14);

    private static int SCORE_X = 100;
    private static int STAGE_PLATFORM_X = SCORE_X + 220;

    public static class GameLine implements PictureLine {

        private final Mode mode;
        private final Difficulty difficulty;

        public GameLine(Mode mode, Difficulty difficulty) {
            this.mode = mode;
            this.difficulty = difficulty;
        }

        @Override
        public void draw(Graphics2D graphics, int y) {
            graphics.setColor(RED);
            graphics.setFont(gameFont);
            graphics.drawString((mode == null ? "" : mode) + " " + (difficulty == null ? "" : difficulty), 30, y);
        }
    }

    public static class ScoreLine implements PictureLine {

        private final models.Score score;

        public ScoreLine(Score score) {
            this.score = score;
        }

        @Override
        public void draw(Graphics2D graphics, int y) {
            graphics.setColor(DARK_GRAY);
            graphics.setFont(normalFont);
            String rank = leftPad(score.rank() + ".", 3);
            String player = score.player.name;
            graphics.drawString(rank, 0, y);

            graphics.setFont(playerFont);
            graphics.drawString(player, 30, y);

            graphics.setColor(BLUE);
            graphics.setFont(scoreFont);
            graphics.drawString(Strings.padStart(score.formattedValue(), Long.valueOf(Long.MAX_VALUE).toString().length() + 6, ' '), SCORE_X, y);


            graphics.setColor(DARK_GRAY);
            graphics.setFont(parameterFont);
            String platform = score.platform == null ? "" : leftPad(score.platform.name, 10);
            if (score.game.platforms.isEmpty() || score.game.platforms.size() == 1) {
                platform = "";
            }
            String stage = score.stage == null ? "" : rightPad(score.stage.toString(), 10);
            graphics.drawString(stage + " " + platform+ " "+score.comment, STAGE_PLATFORM_X, y);
        }
    }

    public static class BreakLine implements PictureLine {

        @Override
{'fraction_non_alphanumeric': 0.10772456055474923, 'fraction_numerical': 0.01128850185453959, 'mean_word_length': 2.614219114219114, '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': '901437', 'n_tokens_mistral': 1786, 'n_tokens_neox': 1677, 'n_words': 444}