<commit_before>//
//  MigrationStep.swift
//  PersistentStoreMigrationKit
//
//  Created by <NAME> on 26.08.15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import Foundation
import CoreData

final class MigrationStep: NSObject {
	let mappingModel: NSMappingModel
	let sourceModel: NSManagedObjectModel
	let destinationModel: NSManagedObjectModel
	
	private var keyValueObservingContext = NSUUID().UUIDString
	
	init(sourceModel: NSManagedObjectModel, destinationModel: NSManagedObjectModel, mappingModel: NSMappingModel) {
		self.sourceModel = sourceModel
		self.destinationModel = destinationModel
		self.mappingModel = mappingModel
	}
	
	private var progress: NSProgress?
	
	func executeForStoreAtURL(sourceURL: NSURL, type sourceStoreType: String, destinationURL: NSURL, storeType destinationStoreType: String) throws {<commit_msg>Add documentation comments to MigrationStep<commit_after>//
//  MigrationStep.swift
//  PersistentStoreMigrationKit
//
//  Created by <NAME> on 26.08.15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import Foundation
import CoreData

/// A `MigrationStep` instance encapsulates the migration from one `NSManagedObjectModel` to another without any intermediate models.
/// Migration is performed via an `NSMigrationManager` using an `NSMappingModel`.
final class MigrationStep: NSObject {
	/// Specifies how to from `sourceModel` to `destinationModel`.
	let mappingModel: NSMappingModel
	/// The model to migrate from.
	let sourceModel: NSManagedObjectModel
	/// The model to migrate to.
	let destinationModel: NSManagedObjectModel
	
	private var keyValueObservingContext = NSUUID().UUIDString
	
	/// Initializes a migration step for a source model, destination model, and a mapping model.
	/// 
	/// - Parameters:
	///   - sourceModel: The model to migrate from.
	///   - destinationModel: The model to migrate to.
	///   - mappingModel: Specifies how to from `sourceModel` to `destinationModel`.
	init(sourceModel: NSManagedObjectModel, destinationModel: NSManagedObjectModel, mappingModel: NSMappingModel) {
		self.sourceModel = sourceModel
		self.destinationModel = destinationModel
		self.mappingModel = mappingModel
	}
	
	private var progress: NSProgress?
	
	/// Performs the migration from the persistent store identified by `sourceURL` and using `sourceModel` to `destinationModel`, saving the result in the persistent store identified by `destinationURL`.
	/// 
	/// Inserts an `NSProgress` instance into the current progress tree.
	/// 
	/// - Parameters:
	///   - sourceURL: Identifies the persistent store to migrate from.
	///   - sourceStoreType: A string constant (such as `NSSQLiteStoreType`) that specifies the source store type.
	///   - destinationURL: Identifies the persistent store to migrate to. May be identical to `sourceURL`.
	///   - destinationStoreType: A string constant (such as `NSSQLiteStoreType`) that specifies the destination store type.
	func executeForStoreAtURL(sourceURL: NSURL, type sourceStoreType: String, destinationURL: NSURL, storeType destinationStoreType: String) throws {
{'fraction_non_alphanumeric': 0.08550065019505852, 'fraction_numerical': 0.006501950585175552, 'mean_word_length': 4.398245614035088, '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': '7241285', 'n_tokens_mistral': 853, 'n_tokens_neox': 798, 'n_words': 290}