<commit_before>// MIT license. Copyright (c) 2016 SwiftyFORM. All rights reserved.
import UIKit

extension FormBuilder {
	public func demo_showInfo(_ text: String) {
		let headerView = SectionHeaderViewFormItem()
		headerView.viewBlock = {
			return InfoView(frame: CGRect(x: 0, y: 0, width: 0, height: 100), text: text)
		}
		self.append(headerView)
	}
}

public class InfoView: UIView {
	public let label: UILabel
	
	public init(frame: CGRect, text: String) {
		self.label = UILabel()
		super.init(frame: frame)
		clipsToBounds = true
		self.addSubview(label)
		label.textColor = UIColor.darkGray
		label.text = text
		label.numberOfLines = 0
		label.textAlignment = .center
		label.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)
	}
	
	public required init(coder aDecoder: NSCoder) {
		fatalError("init(coder:) has not been implemented")
	}
	
	public override func layoutSubviews() {
		super.layoutSubviews()
		let size = label.sizeThatFits(bounds.size)
		label.frame = CGRect(x: bounds.midX - size.width / 2, y: bounds.midY - size.height / 2, width: size.width, height: size.height)
	}
}<commit_msg>Writing documentation<commit_after>// MIT license. Copyright (c) 2016 SwiftyFORM. All rights reserved.
import UIKit

extension FormBuilder {
	/// Install a text header.
	///
 	/// The text can span multiple lines.
	/// The text is centered.
	///
	/// - parameter text: The text to be shown.
	public func demo_showInfo(_ text: String) {
		let headerView = SectionHeaderViewFormItem()
		headerView.viewBlock = {
			return InfoView(frame: CGRect(x: 0, y: 0, width: 0, height: 100), text: text)
		}
		self.append(headerView)
	}
}

/// Centered multiline text useful for headers
public class InfoView: UIView {
	public let label: UILabel
	
	public init(frame: CGRect, text: String) {
		self.label = UILabel()
		super.init(frame: frame)
		clipsToBounds = true
		self.addSubview(label)
		label.textColor = UIColor.darkGray
		label.text = text
		label.numberOfLines = 0
		label.textAlignment = .center
		label.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.body)
	}
	
	public required init(coder aDecoder: NSCoder) {
		fatalError("init(coder:) has not been implemented")
	}
	
	public override func layoutSubviews() {
		super.layoutSubviews()
		let size = label.sizeThatFits(bounds.size)
		label.frame = CGRect(x: bounds.midX - size.width / 2, y: bounds.midY - size.height / 2, width: size.width, height: size.height)
	}
}
{'fraction_non_alphanumeric': 0.11420384772820302, 'fraction_numerical': 0.010642652476463364, 'mean_word_length': 3.9274193548387095, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4196092', 'n_tokens_mistral': 902, 'n_tokens_neox': 811, 'n_words': 224}