<commit_before>package com.evgenii.walktocircle.WalkWalk;

import java.util.Set;
import java.util.Vector;

public class WalkRandomQuote {
    // Random number generator used to pick a random quote.
    // The property is null normally but in the unit test it is set with a fake random number generator.
    public static WalkRandomQuoteNumberGenerator mRandomNumberGenerator;

    /**
     * The main method to be called on the main screen to get the current quote to be shown
     * to the user and the list of already shown quotes.
     * @param allQuotes all the quotes.
     * @param alreadyShownQuotes the list of quotes that are already shown to the user.
     * @return the quote to be shown now and the set of already shown quotes.
     */
    public static WalkQuoteToShow quoteToShow(WalkQuote[] allQuotes, Set<String> alreadyShownQuotes) {
        WalkQuoteToShow result = new WalkQuoteToShow();

        WalkQuote[] newQuotes = excludeQuotes(allQuotes, alreadyShownQuotes);
        result.quoteToShow = pickRandom(newQuotes);

        // Add the picked quote to the list of shown quotes to avoid showing it soon again
        alreadyShownQuotes.add(result.quoteToShow.text);
        result.alreadyShownQuotes = alreadyShownQuotes;

        return result;
    }

    public static WalkRandomQuoteNumberGenerator getRandomNumberGenerator() {
        if (mRandomNumberGenerator == null) {
            return new WalkRandomQuoteNumberGenerator();
        } else {
            return mRandomNumberGenerator;
        }
    }

    public static WalkQuote pickOne(boolean isTutorial) {
        return WalkManyQuotes.tutorialText;
    }

    /**<commit_msg>Walk screen<commit_after>package com.evgenii.walktocircle.WalkWalk;

import java.util.HashSet;
import java.util.Set;
import java.util.Vector;

public class WalkRandomQuote {
    // Random number generator used to pick a random quote.
    // The property is null normally but in the unit test it is set with a fake random number generator.
    public static WalkRandomQuoteNumberGenerator mRandomNumberGenerator;

    /**
     * The main method to be called on the main screen to get the current quote to be shown
     * to the user and the list of already shown quotes.
     * @param allQuotes all the quotes.
     * @param alreadyShownQuotes the list of quotes that are already shown to the user.
     * @return the quote to be shown now and the set of already shown quotes.
     */
    public static WalkQuoteToShow quoteToShow(WalkQuote[] allQuotes, Set<String> alreadyShownQuotes) {
        WalkQuoteToShow result = new WalkQuoteToShow();

        WalkQuote[] newQuotes = excludeQuotes(allQuotes, alreadyShownQuotes);
        result.quoteToShow = pickRandom(newQuotes);

        // Add the picked quote to the list of shown quotes to avoid showing it soon again
        Set<String> newAlreadyShownQuotes = new HashSet<String>();
        newAlreadyShownQuotes.addAll(alreadyShownQuotes);
        newAlreadyShownQuotes.add(result.quoteToShow.text);
        result.alreadyShownQuotes = newAlreadyShownQuotes;

        return result;
    }

    public static WalkRandomQuoteNumberGenerator getRandomNumberGenerator() {
        if (mRandomNumberGenerator == null) {
            return new WalkRandomQuoteNumberGenerator();
        } else {
            return mRandomNumberGenerator;
        }
    }

    public static WalkQuote pickOne(boolean isTutorial) {
        return WalkManyQuotes.tutorialText;
    }

    /**
{'fraction_non_alphanumeric': 0.0618705035971223, 'fraction_numerical': 0.0, 'mean_word_length': 3.113609467455621, 'pattern_counts': {'":': 0, '<': 7, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5013787', 'n_tokens_mistral': 945, 'n_tokens_neox': 897, 'n_words': 326}