<commit_before>//
//  BGPersistentStoreManager.h
//  BGPersistentStoreManager
//
//  Created by <NAME> on 7/16/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

#import <Foundation/Foundation.h>


@import CoreData;


@interface BGPersistentStoreManager : NSObject

@property (readonly, assign, nonatomic) BOOL dataStoreWasResetOrCreatedOnLoad;

+ (BGPersistentStoreManager *)sharedManager;

- (NSManagedObjectContext *)managedObjectContext;

- (void)handleSaveError:(NSError *)error; // This method can be subclassed.
- (void)cleanUpOldObjects; // This method can be subclassed to clean up old objects on save.

- (NSError *)performBlockOnChildContext:(void (^)(NSManagedObjectContext *context, NSString *loggingDescriptor))block withLoggingDescriptor:(NSString *)loggingDescriptor;

#pragma mark - Advanced functions

- (void)performContextSaveOperationAndOptionallyCleanUpOldObjects:(BOOL)cleanUpOldObjects; // NOTE: This is already called automatically on backgrounding/termination, but you can also call it manually. Useful, for example, when completing a background operation, as the app is already in the background then.


@end<commit_msg>Adding to a code comment / function description.<commit_after>//
//  BGPersistentStoreManager.h
//  BGPersistentStoreManager
//
//  Created by <NAME> on 7/16/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

#import <Foundation/Foundation.h>


@import CoreData;


@interface BGPersistentStoreManager : NSObject

@property (readonly, assign, nonatomic) BOOL dataStoreWasResetOrCreatedOnLoad;

+ (BGPersistentStoreManager *)sharedManager;

- (NSManagedObjectContext *)managedObjectContext;

- (void)handleSaveError:(NSError *)error; // This method can be subclassed.
- (void)cleanUpOldObjects; // This method can be subclassed to clean up old objects on save.

- (NSError *)performBlockOnChildContext:(void (^)(NSManagedObjectContext *context, NSString *loggingDescriptor))block withLoggingDescriptor:(NSString *)loggingDescriptor;

#pragma mark - Advanced functions

- (void)performContextSaveOperationAndOptionallyCleanUpOldObjects:(BOOL)cleanUpOldObjects; // NOTE: This is already called automatically on backgrounding/termination, but you can also call it manually. Useful, for example, when completing a background operation, as the app is already in the background then. Also useful for after a cache loss occurs to force re-save persisted data immediately that was restored from another source.


@end
{'fraction_non_alphanumeric': 0.09223300970873786, 'fraction_numerical': 0.007281553398058253, 'mean_word_length': 5.612299465240642, 'pattern_counts': {'":': 0, '<': 9, '<?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': '5906996', 'n_tokens_mistral': 705, 'n_tokens_neox': 658, 'n_words': 221}