<commit_before>//  Copyright (c) 2015 <NAME>. All rights reserved.

public struct NodeView<T> {
	public let graph: Graph<T>
	public let identifier: Identifier

	public var value: T? {
		return graph.nodes[identifier]
	}

	public var inEdges: SequenceOf<Edge> {
		return SequenceOf(lazy(graph.edges).filter { $0.destination.identifier == self.identifier })
	}

	public var inDegree: Int {
		return reduce(lazy(inEdges).map(const(1)), 0, +)
	}

	public var outEdges: SequenceOf<Edge> {
		return SequenceOf(lazy(graph.edges).filter { $0.source.identifier == self.identifier })
	}

	public var outDegree: Int {
		return reduce(lazy(outEdges).map(const(1)), 0, +)
	}
}

public func == <T: Equatable> (left: NodeView<T>, right: NodeView<T>) -> Bool {
	return
		left.identifier == right.identifier
	&&	left.graph == right.graph
}


// MARK: - Imports

import Prelude<commit_msg>NodeViews copy their value.<commit_after>//  Copyright (c) 2015 <NAME>. All rights reserved.

public struct NodeView<T> {
	public let graph: Graph<T>
	public let identifier: Identifier
	public let value: T

	public var inEdges: SequenceOf<Edge> {
		return SequenceOf(lazy(graph.edges).filter { $0.destination.identifier == self.identifier })
	}

	public var inDegree: Int {
		return reduce(lazy(inEdges).map(const(1)), 0, +)
	}

	public var outEdges: SequenceOf<Edge> {
		return SequenceOf(lazy(graph.edges).filter { $0.source.identifier == self.identifier })
	}

	public var outDegree: Int {
		return reduce(lazy(outEdges).map(const(1)), 0, +)
	}
}

public func == <T: Equatable> (left: NodeView<T>, right: NodeView<T>) -> Bool {
	return
		left.identifier == right.identifier
	&&	left.graph == right.graph
}


// MARK: - Imports

import Prelude
{'fraction_non_alphanumeric': 0.14393939393939395, 'fraction_numerical': 0.011655011655011656, 'mean_word_length': 4.332298136645963, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, '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': '2460728', 'n_tokens_mistral': 635, 'n_tokens_neox': 584, 'n_words': 146}