<commit_before>define(['jQuery'
				'Underscore'
				'Backbone'
				'models/filter'
				'views/scheduler/filters/checkbox-filter'], ($,_, Backbone, FilterModel, CheckBoxFilterView) ->

	class FriendsFilter extends FilterModel

		defaults:
			name: "Friends"
			horizontal: false
			options: ['friends','no friends']
			values: [true, true]

		initialize: ->
			@active = false
			@view = CheckBoxFilterView


		# Logic section of the filter
		filter: (section) =>
			# Quickreference attributes
			values = @.get 'values'

			hasFriends = (section.get 'friends')?.length
			# Remove classes without friends
			if hasFriends > 0 and not values[0]
				section.set 'visible', false
				return
			# Only classes with friends
			if hasFriends < 0 and not values[1]
				section.set 'visible', false
				return

		viewChange: (values) ->
			@active = false in values
			@.set 'values', values

	FriendsFilter
)<commit_msg>Friends filter looks at .sectionFriends for each section<commit_after>define(['jQuery'
				'Underscore'
				'Backbone'
				'models/filter'
				'views/scheduler/filters/checkbox-filter'], ($,_, Backbone, FilterModel, CheckBoxFilterView) ->

	class FriendsFilter extends FilterModel

		defaults:
			name: "Friends"
			horizontal: false
			options: ['friends','no friends']
			values: [true, true]

		initialize: ->
			@active = false
			@view = CheckBoxFilterView


		# Logic section of the filter
		filter: (section) =>
			# Quickreference attributes
			values = @.get 'values'

			hasFriends = !!(Shark.sectionFriends[section.id])
			# Remove classes without friends
			if hasFriends and not values[0]
				section.set 'visible', false
				return
			# Only classes with friends
			if not hasFriends and not values[1]
				section.set 'visible', false
				return

		viewChange: (values) ->
			@active = false in values
			@.set 'values', values

	FriendsFilter
)
{'fraction_non_alphanumeric': 0.11099252934898612, 'fraction_numerical': 0.0032017075773745998, 'mean_word_length': 3.4536817102137767, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 12, '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': '5218358', 'n_tokens_mistral': 696, 'n_tokens_neox': 557, 'n_words': 167}