<commit_before>package com.twu.biblioteca.Menu;

import com.twu.biblioteca.Book.Book;
import com.twu.biblioteca.Exceptions.BookNotBorrowable;
import com.twu.biblioteca.Library.Library;
import com.twu.biblioteca.Utilities.Messages;
import com.twu.biblioteca.Utilities.Utilities;

import java.util.InputMismatchException;
import java.util.Scanner;

/**
 * BorrowMenu is responsible for handling the borrow menu navigation.
 *
 * @author <NAME>
 * @version 1.0
 */
public class BorrowMenuImpl implements BorrowMenu {

    private Scanner input;
    private Library library;

    /**
     * Construct a borrow menu with access to the Library.
     */
    public BorrowMenuImpl(Library library) {
        this.library = library;
        input = new Scanner(System.in);
    }

    /**
     * Display the borrow menu options.
     */
    @Override
    public void displayBorrowMenu() {
        try {
            System.out.print(Messages.borrowMessage());
            System.out.print(Messages.bookListingMessage());
            System.out.println(Utilities.displayFormattedBookList(library.getAvailableBooks()));
            System.out.print(Messages.optionMessage());
            borrowMenuOptions(input.nextInt(10));
        } catch (InputMismatchException e) {
            System.out.println(Messages.incorrectInputMessage());
            input.nextLine();
        }
    }

    /**
     * Dispatch to borrow a book.
     *
     * @param option The option entered on the return menu.
     */
    private void borrowMenuOptions(int option) {
        if (option == 0) {
            System.out.print("\n");<commit_msg>Code cleanup<commit_after>package com.twu.biblioteca.Menu;

import com.twu.biblioteca.Book.Book;
import com.twu.biblioteca.Exceptions.BookNotBorrowable;
import com.twu.biblioteca.Library.Library;
import com.twu.biblioteca.Utilities.Messages;
import com.twu.biblioteca.Utilities.Utilities;

import java.util.InputMismatchException;
import java.util.Scanner;

/**
 * BorrowMenu is responsible for handling the borrow menu navigation.
 *
 * @author <NAME>
 * @version 1.0
 */
public class BorrowMenuImpl implements BorrowMenu {

    private Scanner input;
    private Library library;

    /**
     * Construct a borrow menu with access to the Library.
     */
    public BorrowMenuImpl(Library library) {
        this.library = library;
        input = new Scanner(System.in);
    }

    /**
     * Display the borrow menu options.
     */
    @Override
    public void displayBorrowMenu() {
        try {
            System.out.print(Messages.borrowMessage());
            System.out.print(Messages.bookListingMessage());
            System.out.println(Utilities.displayFormattedBookList(library.getAvailableBooks()));
            System.out.print(Messages.optionMessage());
            borrowMenuOptions(input.nextInt(10));
        } catch (InputMismatchException e) {
            System.out.print(Messages.incorrectInputMessage());
            input.nextLine();
        }
    }

    /**
     * Dispatch to borrow a book.
     *
     * @param option The option entered on the return menu.
     */
    private void borrowMenuOptions(int option) {
        if (option == 0) {
            System.out.print("\n");
{'fraction_non_alphanumeric': 0.10748679714196956, 'fraction_numerical': 0.0031065548306927616, 'mean_word_length': 2.7096774193548385, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5209388', 'n_tokens_mistral': 936, 'n_tokens_neox': 929, 'n_words': 198}