<commit_before>package com.urd.triple.core;

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;

import android.util.SparseArray;

public class Hero {

    public static final int UNKNOWN = 0;

    public int id;
    public String name;
    public String pic;
    public String shortName;
    public String portraitPic;
    public List<String> skills;

    public static class Generator {

        LinkedList<Integer> mHeroes;

        // 主公分配 3主公 + 2英雄
        public Generator() {
            mHeroes = new LinkedList<Integer>();
            for (Hero hero : getHeroes()) {
                mHeroes.add(hero.id);
            }
            Collections.shuffle(mHeroes.subList(3, mHeroes.size() - 1));
        }

        // 普通角色分配
        public Generator(int except) {
            this();

            Collections.shuffle(mHeroes);
            mHeroes.remove(Integer.valueOf(except));
        }

        public List<Integer> generate(int count) {
            List<Integer> heroes = new ArrayList<Integer>(count);
            for (int i = 0; i < count; i++) {
                heroes.add(mHeroes.poll());
            }

            return heroes;
        }
    }

    public static Hero valueOf(int hero) {
        return HERO_MAP.get(hero);
    }

    public static List<Hero> getHeroes() {
        List<Hero> heroes = new ArrayList<Hero>();<commit_msg>修正主公选将列表不包含三位主公的问题<commit_after>package com.urd.triple.core;

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;

import android.util.SparseArray;

public class Hero {

    public static final int UNKNOWN = 0;

    public int id;
    public String name;
    public String pic;
    public String shortName;
    public String portraitPic;
    public List<String> skills;

    public static class Generator {

        LinkedList<Integer> mHeroes;

        // 主公分配 3主公 + 2英雄
        public Generator() {
            mHeroes = new LinkedList<Integer>();
            for (Hero hero : getHeroes()) {
                mHeroes.add(hero.id);
            }
            Collections.shuffle(mHeroes);
            mHeroes.remove(Integer.valueOf(201));
            mHeroes.remove(Integer.valueOf(210));
            mHeroes.remove(Integer.valueOf(216));
            mHeroes.addFirst(216);
            mHeroes.addFirst(210);
            mHeroes.addFirst(201);
        }

        // 普通角色分配
        public Generator(int except) {
            this();

            Collections.shuffle(mHeroes);
            mHeroes.remove(Integer.valueOf(except));
        }

        public List<Integer> generate(int count) {
            List<Integer> heroes = new ArrayList<Integer>(count);
            for (int i = 0; i < count; i++) {
                heroes.add(mHeroes.poll());
            }

            return heroes;
        }
    }

    public static Hero valueOf(int hero) {
        return HERO_MAP.get(hero);
    }

    public static List<Hero> getHeroes() {
        List<Hero> heroes = new ArrayList<Hero>();
{'fraction_non_alphanumeric': 0.1054498548855208, 'fraction_numerical': 0.009029345372460496, 'mean_word_length': 2.0116504854368933, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 21, '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': '3497958', 'n_tokens_mistral': 987, 'n_tokens_neox': 949, 'n_words': 209}