<commit_before>//
//  CoreDataManager.swift
//  Todos
//
//  Created by <NAME> on 12/10/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import CoreData
import GROCloudStore

#if os(OSX)
import AppKit
#endif

class CoreDataManager: NSObject {
    
    // MARK: - Lifecycle
    
    static let sharedManager = CoreDataManager()
    
    override init() {
        super.init()
    }
    
    // MARK: - Core Data stack
    
    lazy var managedObjectContext: NSManagedObjectContext? = {
        let coordinator = self.persistentStoreCoordinator
        if coordinator == nil {
            return nil
        }
        
        var managedObjectContext = NSManagedObjectContext(concurrencyType: .MainQueueConcurrencyType)
        managedObjectContext.persistentStoreCoordinator = coordinator
        managedObjectContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy
        return managedObjectContext
    }()
    
    // MARK: - Public
  
    #if os(iOS)
    func fetchedResultsControllerForEntityName(name: String, sortDescriptors: [NSSortDescriptor], predicate:NSPredicate! = nil) -> NSFetchedResultsController {
        let managedObjectContext = self.managedObjectContext
        let fetchRequest = NSFetchRequest()<commit_msg>Don't extend NSObject<commit_after>//
//  CoreDataManager.swift
//  Todos
//
//  Created by <NAME> on 12/10/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import CoreData
import GROCloudStore

#if os(OSX)
import AppKit
#endif

class CoreDataManager {
    
    static let sharedManager = CoreDataManager()
    
    // MARK: - Core Data stack
    
    lazy var managedObjectContext: NSManagedObjectContext? = {
        let coordinator = self.persistentStoreCoordinator
        if coordinator == nil {
            return nil
        }
        
        var managedObjectContext = NSManagedObjectContext(concurrencyType: .MainQueueConcurrencyType)
        managedObjectContext.persistentStoreCoordinator = coordinator
        managedObjectContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy
        return managedObjectContext
    }()
    
    // MARK: - Public
  
    #if os(iOS)
    func fetchedResultsControllerForEntityName(name: String, sortDescriptors: [NSSortDescriptor], predicate:NSPredicate! = nil) -> NSFetchedResultsController {
        let managedObjectContext = self.managedObjectContext
        let fetchRequest = NSFetchRequest()
{'fraction_non_alphanumeric': 0.07918739635157546, 'fraction_numerical': 0.008291873963515755, 'mean_word_length': 2.936378466557912, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '1063682', 'n_tokens_mistral': 688, 'n_tokens_neox': 650, 'n_words': 155}