<commit_before>window.showRealNames = () => {
	const storageKey = 'cachedNames';

	const getCachedUsers = cb => {
		chrome.storage.local.get(storageKey, data => cb(data[storageKey]));
	};

	const updateCachedUsers = users => {
		chrome.storage.local.set({[storageKey]: users});
	};

	const addUsersName = (user, name) => {
		const $usernameLinks = $(`.timeline-comment-header-text:not(.has-full-name) a[href="/${user}"]`);
		$usernameLinks.each((i, userLink) => {
			$(`<span class="comment-full-name">`).text(`${name} -`).insertAfter(userLink);
			$(userLink).closest('.timeline-comment-header-text').addClass('has-full-name');
		});
	};

	getCachedUsers((users = {}) => {
		const usersOnPage = $('.js-discussion .author').get().map(el => el.innerText);
		const uniqueUsers = new Set(usersOnPage);

		// Add cached users to DOM first, since the calls for everyone else will be slow
		for (const user of uniqueUsers) {
			const cachedName = users[user];
			if (cachedName) {
				addUsersName(user, cachedName);
				uniqueUsers.delete(user);
			}
		}

		const userUrl = user => `https://github.com/${user}/following`;
		const requests = Array.from(uniqueUsers).map(username => {
			const req = fetch(userUrl(username));
			return req.then(res => res.text()).then(profile => ({<commit_msg>Don't add full name if it's identical to username (#460)<commit_after>window.showRealNames = () => {
	const storageKey = 'cachedNames';

	const getCachedUsers = cb => {
		chrome.storage.local.get(storageKey, data => cb(data[storageKey]));
	};

	const updateCachedUsers = users => {
		chrome.storage.local.set({[storageKey]: users});
	};

	const addUsersName = (user, name) => {
		const $usernameLinks = $(`.timeline-comment-header-text:not(.has-full-name) a[href="/${user}"]`);
		$usernameLinks.each((i, userLink) => {
			if (user !== name) {
				$(`<span class="comment-full-name">`).text(`${name} -`).insertAfter(userLink);
			}
			$(userLink).closest('.timeline-comment-header-text').addClass('has-full-name');
		});
	};

	getCachedUsers((users = {}) => {
		const usersOnPage = $('.js-discussion .author').get().map(el => el.innerText);
		const uniqueUsers = new Set(usersOnPage);

		// Add cached users to DOM first, since the calls for everyone else will be slow
		for (const user of uniqueUsers) {
			const cachedName = users[user];
			if (cachedName) {
				addUsersName(user, cachedName);
				uniqueUsers.delete(user);
			}
		}

		const userUrl = user => `https://github.com/${user}/following`;
		const requests = Array.from(uniqueUsers).map(username => {
			const req = fetch(userUrl(username));
			return req.then(res => res.text()).then(profile => ({
{'fraction_non_alphanumeric': 0.18738194182092935, 'fraction_numerical': 0.0011333585190782018, 'mean_word_length': 4.306613226452906, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 2, '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': '3913605', 'n_tokens_mistral': 938, 'n_tokens_neox': 850, 'n_words': 172}