<commit_before>extension Array {
	func prettyPrint(initiator: String = "[",
	                 separator: String = ", ",
	                 terminator: String = "]") {
		let count = self.count
		guard let lastElement = self.last else {
			print(initiator + terminator)
			return
		}
		guard count > 1 else {
			print(initiator + "\(self[0])" + terminator)
			return
		}

		for element in self.dropLast() {
			print("\(element)" + separator, terminator: "")
		}

		print("\(lastElement)" + terminator)
	}

	func prettyPrintInLines() {
		self.prettyPrint(initiator: "", separator: "\n", terminator: "")
	}

	subscript (safe index: Int) -> Element? {
		guard index < count else { return nil }
		return self[index]
	}
}

protocol MutableRandomAccessCollection:
MutableCollection, RandomAccessCollection { }

extension MutableRandomAccessCollection {
	mutating func shift() {
		guard let first = self.first,
			count > 1 else { return }

		let lastValidIndex = index(before: endIndex)

		var i = startIndex
		while i != lastValidIndex {
			let next = index(after: i)
			self[i] = self[next]
			i = next
		}

		self[lastValidIndex] = first
	}

	func shifted() -> Self {
		var copy = self
		copy.shift()
		return copy
	}
}

extension Array: MutableRandomAccessCollection { }

extension String {
	public func withMutableCString<Result>(
		_ closure: @escaping (UnsafeMutablePointer<Int8>) throws -> Result)
		rethrows -> Result {

			do {
				return try self.withCString { pointer in
					let mutablePointer = UnsafeMutablePointer<Int8>(
						mutating: pointer)
					return try closure(mutablePointer)
				}
			} catch (let error) {
				throw error
			}
	}
}<commit_msg>Removed dead code from C interop w/ flex/yacc.<commit_after>extension Array {
	func prettyPrint(initiator: String = "[",
	                 separator: String = ", ",
	                 terminator: String = "]") {
		let count = self.count
		guard let lastElement = self.last else {
			print(initiator + terminator)
			return
		}
		guard count > 1 else {
			print(initiator + "\(self[0])" + terminator)
			return
		}

		for element in self.dropLast() {
			print("\(element)" + separator, terminator: "")
		}

		print("\(lastElement)" + terminator)
	}

	func prettyPrintInLines() {
		self.prettyPrint(initiator: "", separator: "\n", terminator: "")
	}

	subscript (safe index: Int) -> Element? {
		guard index < count else { return nil }
		return self[index]
	}
}

protocol MutableRandomAccessCollection:
MutableCollection, RandomAccessCollection { }

extension MutableRandomAccessCollection {
	mutating func shift() {
		guard let first = self.first,
			count > 1 else { return }

		let lastValidIndex = index(before: endIndex)

		var i = startIndex
		while i != lastValidIndex {
			let next = index(after: i)
			self[i] = self[next]
			i = next
		}

		self[lastValidIndex] = first
	}

	func shifted() -> Self {
		var copy = self
		copy.shift()
		return copy
	}
}

extension Array: MutableRandomAccessCollection { }
{'fraction_non_alphanumeric': 0.11847862672500842, 'fraction_numerical': 0.0026926960619320095, 'mean_word_length': 3.2096317280453257, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 16, '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': '7620414', 'n_tokens_mistral': 1064, 'n_tokens_neox': 910, 'n_words': 248}