<commit_before>
function ResourceView(calendar) {
	AgendaView.call(this, calendar); // call the super-constructor

	this.cellToDate = function() {
		return this.start.clone();
	};
}


ResourceView.prototype = createObject(AgendaView.prototype); // extends AgendaView
$.extend(ResourceView.prototype, {

	resources: function() {
		return this.calendar.fetchResources();
	},

	hasResource: function(event, resource) {
		return event.resources && $.grep(event.resources, function(id) {
			return id == resource.id;
		}).length;
	},

	// Called when a new selection is made. Updates internal state and triggers handlers.
	reportSelection: function(start, end, ev, resources) {
		this.isSelected = true;

		this.calendar.trigger.apply(
			this.calendar, ['select', this, start, end, ev, this, resources]
		);

	},

	// Used by the `headHtml` method, via RowRenderer, for rendering the HTML of a day-of-week header cell
	headCellHtml: function(row, col, date) {
		var resource = this.resources()[col];
		var classes = [
			'fc-day-header',
			this.widgetHeaderClass,
			'fc-' + dayIDs[date.day()]
		];

		if(resource) {
			classes.push(resource.className);
		}

		return '' +
			'<th class="'+ classes.join(' ') +'">' +
			((resource) ? htmlEscape(resource.name) : '') +
			'</th>';
	}

});
<commit_msg>adds `hasResource` as an option<commit_after>
function ResourceView(calendar) {
	AgendaView.call(this, calendar); // call the super-constructor

	this.cellToDate = function() {
		return this.start.clone();
	};
}


ResourceView.prototype = createObject(AgendaView.prototype); // extends AgendaView
$.extend(ResourceView.prototype, {

	resources: function() {
		return this.calendar.fetchResources();
	},

	hasResource: function(event, resource) {
		if(this.opt('hasResource')) {
			return this.opt('hasResource').apply(this, arguments);
		}
		
		return event.resources && $.grep(event.resources, function(id) {
			return id == resource.id;
		}).length;
	},

	// Called when a new selection is made. Updates internal state and triggers handlers.
	reportSelection: function(start, end, ev, resources) {
		this.isSelected = true;

		this.calendar.trigger.apply(
			this.calendar, ['select', this, start, end, ev, this, resources]
		);

	},

	// Used by the `headHtml` method, via RowRenderer, for rendering the HTML of a day-of-week header cell
	headCellHtml: function(row, col, date) {
		var resource = this.resources()[col];
		var classes = [
			'fc-day-header',
			this.widgetHeaderClass,
			'fc-' + dayIDs[date.day()]
		];

		if(resource) {
			classes.push(resource.className);
		}

		return '' +
			'<th class="'+ classes.join(' ') +'">' +
			((resource) ? htmlEscape(resource.name) : '') +
			'</th>';
	}

});

{'fraction_non_alphanumeric': 0.1583610188261351, 'fraction_numerical': 0.0, 'mean_word_length': 3.9452554744525545, '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': '1436667', 'n_tokens_mistral': 951, 'n_tokens_neox': 853, 'n_words': 206}