<commit_before>var bookList = [
	{
		_id: 0,
		title: 'Wool',
		author: '<NAME>',
		genre: 'Science Fiction',
		read: false
	},
	{
		_id: 1,
		title: 'To Kill a Mockingbird',
		author: '<NAME>',
		genre: 'Fiction',
		read: false
	},
	{
		_id: 2,
		title: 'Dune',
		author: '<NAME>',
		genre: 'Science Fiction',
		read: false
	},
	{
		_id: 3,
		title: 'The Fall of the Ottomans',
		author: '<NAME>',
		genre: 'History',
		read: false
	},
	{
		_id: 4,
		title: 'Empire Falls',
		author: '<NAME>',
		genre: 'Fiction',
		read: false
	},
	{
		_id: 5,
		title: 'Shift',
		author: '<NAME>',
		genre: 'Science Fiction',
		read: false
	},
	{
		_id: 6,
		title: 'Truman',
		author: '<NAME>',
		genre: 'History',
		read: false
	},
	{
		_id: 7,
		title: 'The Amazing Adventures of Kavalier and Klay',
		author: '<NAME>',
		genre: 'Fiction',
		read: false
	},
	{
		_id: 8,
		title: 'Ulysses',
		author: '<NAME>',
		genre: 'Fiction',
		read: false
	},
	{
		_id: 9,
		title: 'The Hobbit',
		author: '<NAME>',
		genre: 'Fantasy',
		read: false
	}
];

var _ = require('underscore');

function getBooks() {
	return bookList;
}

function getBook(id) {
	console.log('id: ', id);
	id = parseInt(id, 10);
	return _.find(bookList, function (book) {
		console.log('book._id: ', book._id);
		return book._id === id;
	});
}

function addBook(book) {
	if (book) {
		bookList.push(book);
	}
}

function removeBook(id) {
	var id = parseInt(id, 10);
	var index = _.findIndex(bookList, function (book) {
		return book._id === id;
	});
	bookList.splice(index, 1);
}

function updateBook(book) {
	var existingBook = getBook(book._id);

	existingBook.title = book.title;
	existingBook.author = book.author;
	existingBook.genre = book.genre

	return existingBook;
}

module.exports = {
	getBooks: getBooks,
	getBook: getBook,
	addBook: addBook,<commit_msg>Update books.js<commit_after>var bookList = [
	{
		_id: 0,
		title: 'Wool',
		author: '<NAME>',
		genre: 'Science Fiction',
		read: false
	},
	{
		_id: 1,
		title: 'To Kill a Mockingbird',
		author: '<NAME>',
		genre: 'Fiction',
		read: false
	},
	{
		_id: 2,
		title: 'Dune',
		author: '<NAME>',
		genre: 'Science Fiction',
		read: false
	},
	{
		_id: 3,
		title: 'The Fall of the Ottomans',
		author: '<NAME>',
		genre: 'History',
		read: false
	},
	{
		_id: 4,
		title: 'Empire Falls',
		author: '<NAME>',
		genre: 'Fiction',
		read: false
	},
	{
		_id: 5,
		title: 'Shift',
		author: '<NAME>',
		genre: 'Science Fiction',
		read: false
	},
	{
		_id: 6,
		title: 'Truman',
		author: '<NAME>',
		genre: 'History',
		read: false
	},
	{
		_id: 7,
		title: 'The Amazing Adventures of Kavalier and Klay',
		author: '<NAME>',
		genre: 'Fiction',
		read: false
	},
	{
		_id: 8,
		title: 'Ulysses',
		author: '<NAME>',
		genre: 'Fiction',
		read: false
	},
	{
		_id: 9,
		title: 'The Hobbit',
		author: '<NAME>',
		genre: 'Fantasy',
		read: false
	}
];

var _ = require('underscore');

function getBooks() {
	return bookList;
}

function getBook(id) {
	console.log('id: ', id);
	id = parseInt(id, 10);
	return _.find(bookList, function (book) {
		console.log('book._id: ', book._id);
		return book._id === id;
	});
}

function addBook(book) {
	if (book) {
		bookList.push(book);
	}
}

function removeBook(id) {
	var id = parseInt(id, 10);
	var index = _.findIndex(bookList, function (book) {
		return book._id === id;
	});
	bookList.splice(index, 1);
}

module.exports = {
	getBooks: getBooks,
	getBook: getBook,
	addBook: addBook,
{'fraction_non_alphanumeric': 0.18508848273861328, 'fraction_numerical': 0.008703220191470844, 'mean_word_length': 3.370088719898606, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '5114119', 'n_tokens_mistral': 1590, 'n_tokens_neox': 1441, 'n_words': 353}