<commit_before>import org.apache.commons.io.FileUtils

import java.nio.file.FileVisitResult
import java.nio.file.FileVisitor
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.attribute.BasicFileAttributes

/**
 * @author <NAME> (<EMAIL> at g<EMAIL> dot <EMAIL>)
 */
class Utils {
    File fileInProject(name) {
        return new File(projectDir, name)
    }

    File fileFromTemplateDirectory(name) {
        return new File(templateDir, name)
    }

    void copyDirectoryFromTemplate(String directory) {
        FileUtils.copyDirectoryToDirectory(fileFromTemplateDirectory(directory), projectDir)
    }

    void copyFileFromTemplate(String fileName) {
        FileUtils.copyFileToDirectory(fileFromTemplateDirectory(fileName), projectDir)
    }

    String packageNameToPackagePath(String packageName) {
        return packageName.replace('.' as char, '/' as char)
    }

    def askBoolean(String message, String defaultValue, String property) {
        def positiveAnswer = ['yes', 'true', 'ok', 'y']
        String answer = ask("${message}. Positive answer is one of \'${positiveAnswer.join('\', \'')}\' [${defaultValue}]: ", defaultValue, property).toLowerCase()
        return positiveAnswer.find {
            return it == answer
        }
    }

    def askPredefined(String message, String defaultValue, List<String> answers, String property,
                      boolean showAnswers = true) {
        if (showAnswers) {<commit_msg>Punctuation usually is part of message<commit_after>import org.apache.commons.io.FileUtils

import java.nio.file.FileVisitResult
import java.nio.file.FileVisitor
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.attribute.BasicFileAttributes

/**
 * @author <NAME> (<EMAIL> at gmail dot com)
 */
class Utils {
    File fileInProject(name) {
        return new File(projectDir, name)
    }

    File fileFromTemplateDirectory(name) {
        return new File(templateDir, name)
    }

    void copyDirectoryFromTemplate(String directory) {
        FileUtils.copyDirectoryToDirectory(fileFromTemplateDirectory(directory), projectDir)
    }

    void copyFileFromTemplate(String fileName) {
        FileUtils.copyFileToDirectory(fileFromTemplateDirectory(fileName), projectDir)
    }

    String packageNameToPackagePath(String packageName) {
        return packageName.replace('.' as char, '/' as char)
    }

    def askBoolean(String message, String defaultValue, String property) {
        def positiveAnswer = ['yes', 'true', 'ok', 'y']
        String answer = ask("${message} Positive answer is one of \'${positiveAnswer.join('\', \'')}\' [${defaultValue}]: ", defaultValue, property).toLowerCase()
        return positiveAnswer.find {
            return it == answer
        }
    }

    def askPredefined(String message, String defaultValue, List<String> answers, String property,
                      boolean showAnswers = true) {
        if (showAnswers) {
{'fraction_non_alphanumeric': 0.10923233006425431, 'fraction_numerical': 0.0, 'mean_word_length': 3.4083457526080476, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '7053427', 'n_tokens_mistral': 829, 'n_tokens_neox': 802, 'n_words': 197}