<commit_before>//
//  SVFunctional.h
//  RedLaser
//
//  Created by <NAME> on 4/3/13.
//  Copyright (c) 2013 eBay, Inc. All rights reserved.
//

typedef id(^SVMapToIntegerBlock)(NSUInteger i);
FOUNDATION_EXTERN NSArray* SVMapToInteger(NSUInteger integer, SVMapToIntegerBlock block);
FOUNDATION_EXTERN NSArray* SVFilterMapToInteger(NSUInteger integer, SVMapToIntegerBlock block);

typedef id(^SVMapBlock)(id object);
FOUNDATION_EXTERN NSArray* SVMap(NSArray* array, SVMapBlock block);
FOUNDATION_EXTERN NSArray* SVFilterMap(NSArray* array, SVMapBlock block);
FOUNDATION_EXTERN NSSet* SVMapSet(NSSet* set, SVMapBlock block);
FOUNDATION_EXTERN NSDictionary* SVMapToDictionaryObjects(NSArray *array, SVMapBlock block);
FOUNDATION_EXTERN NSDictionary* SVMapToDictionaryKeys(NSArray *array, SVMapBlock block);

typedef void(^SVDoubleMapToDictionaryBlock)(id object, id *key, id *value);
FOUNDATION_EXTERN NSDictionary* SVDoubleMapToDictionary(NSArray *array, SVDoubleMapToDictionaryBlock block);

typedef id(^SVMapDictionaryBlock)(id key, id object);
FOUNDATION_EXTERN NSDictionary* SVMapDictionary(NSDictionary *dictionary, SVMapDictionaryBlock block);

typedef BOOL(^SVFilterBlock)(id object);
FOUNDATION_EXTERN NSArray* SVFilter(NSArray* array, SVFilterBlock block);

typedef BOOL(^SVAllBlock)(id object);
FOUNDATION_EXTERN BOOL SVAll(id<NSFastEnumeration> enumerable, SVAllBlock block);

typedef BOOL(^SVAnyBlock)(id object);
FOUNDATION_EXTERN BOOL SVAny(id<NSFastEnumeration> enumerable, SVAnyBlock block);

typedef BOOL(^SVFindBlock)(id object);
FOUNDATION_EXTERN id SVFind(id<NSFastEnumeration> enumerable, SVFindBlock block);
FOUNDATION_EXTERN NSUInteger SVFindIndex(id<NSFastEnumeration> enumerable, SVFindBlock block);

typedef void(^SVDoubleIterateBlock)(id object1, id object2);
FOUNDATION_EXTERN void SVDoubleIterate(NSArray *array1, NSArray *array2, SVDoubleIterateBlock block);

typedef id(^SVInterleaveBlock)(void);
FOUNDATION_EXTERN NSArray* SVInterleave(NSArray *array, SVInterleaveBlock block);

typedef BOOL(^SVGroupBlock)(id object1, id object2);
FOUNDATION_EXTERN NSArray *SVGroup(NSArray *array, SVGroupBlock block);

typedef double(^SVDoubleComparisonBlock)(id object);
FOUNDATION_EXTERN id SVMinObjectDouble(id<NSFastEnumeration> enumerable, SVDoubleComparisonBlock block);
FOUNDATION_EXTERN double SVMinDouble(id<NSFastEnumeration> enumerable, SVDoubleComparisonBlock block);

FOUNDATION_EXTERN NSDictionary *SVBucketToDictionary(id<NSFastEnumeration> enumerable, SVMapBlock block);

typedef id(^SVIfNotNilBlock)(id object);
FOUNDATION_STATIC_INLINE id SVIfNotNil(id object, SVIfNotNilBlock block)
{
    return object ? block(object) : nil;
}
<commit_msg>Rename SVIfNotNil to SVMaybe<commit_after>//
//  SVFunctional.h
//  RedLaser
//
//  Created by <NAME> on 4/3/13.
//  Copyright (c) 2013 eBay, Inc. All rights reserved.
//

typedef id(^SVMapToIntegerBlock)(NSUInteger i);
FOUNDATION_EXTERN NSArray* SVMapToInteger(NSUInteger integer, SVMapToIntegerBlock block);
FOUNDATION_EXTERN NSArray* SVFilterMapToInteger(NSUInteger integer, SVMapToIntegerBlock block);

typedef id(^SVMapBlock)(id object);
FOUNDATION_EXTERN NSArray* SVMap(NSArray* array, SVMapBlock block);
FOUNDATION_EXTERN NSArray* SVFilterMap(NSArray* array, SVMapBlock block);
FOUNDATION_EXTERN NSSet* SVMapSet(NSSet* set, SVMapBlock block);
FOUNDATION_EXTERN NSDictionary* SVMapToDictionaryObjects(NSArray *array, SVMapBlock block);
FOUNDATION_EXTERN NSDictionary* SVMapToDictionaryKeys(NSArray *array, SVMapBlock block);

typedef void(^SVDoubleMapToDictionaryBlock)(id object, id *key, id *value);
FOUNDATION_EXTERN NSDictionary* SVDoubleMapToDictionary(NSArray *array, SVDoubleMapToDictionaryBlock block);

typedef id(^SVMapDictionaryBlock)(id key, id object);
FOUNDATION_EXTERN NSDictionary* SVMapDictionary(NSDictionary *dictionary, SVMapDictionaryBlock block);

typedef BOOL(^SVFilterBlock)(id object);
FOUNDATION_EXTERN NSArray* SVFilter(NSArray* array, SVFilterBlock block);

typedef BOOL(^SVAllBlock)(id object);
FOUNDATION_EXTERN BOOL SVAll(id<NSFastEnumeration> enumerable, SVAllBlock block);

typedef BOOL(^SVAnyBlock)(id object);
FOUNDATION_EXTERN BOOL SVAny(id<NSFastEnumeration> enumerable, SVAnyBlock block);

typedef BOOL(^SVFindBlock)(id object);
FOUNDATION_EXTERN id SVFind(id<NSFastEnumeration> enumerable, SVFindBlock block);
FOUNDATION_EXTERN NSUInteger SVFindIndex(id<NSFastEnumeration> enumerable, SVFindBlock block);

typedef void(^SVDoubleIterateBlock)(id object1, id object2);
FOUNDATION_EXTERN void SVDoubleIterate(NSArray *array1, NSArray *array2, SVDoubleIterateBlock block);

typedef id(^SVInterleaveBlock)(void);
FOUNDATION_EXTERN NSArray* SVInterleave(NSArray *array, SVInterleaveBlock block);

typedef BOOL(^SVGroupBlock)(id object1, id object2);
FOUNDATION_EXTERN NSArray *SVGroup(NSArray *array, SVGroupBlock block);

typedef double(^SVDoubleComparisonBlock)(id object);
FOUNDATION_EXTERN id SVMinObjectDouble(id<NSFastEnumeration> enumerable, SVDoubleComparisonBlock block);
FOUNDATION_EXTERN double SVMinDouble(id<NSFastEnumeration> enumerable, SVDoubleComparisonBlock block);

FOUNDATION_EXTERN NSDictionary *SVBucketToDictionary(id<NSFastEnumeration> enumerable, SVMapBlock block);

typedef id(^SVMaybeBlock)(id object);
FOUNDATION_STATIC_INLINE id SVMaybe(id object, SVMaybeBlock block)
{
    return object ? block(object) : nil;
}

{'fraction_non_alphanumeric': 0.09073935772964899, 'fraction_numerical': 0.005227781926811053, 'mean_word_length': 9.714, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '4319204', 'n_tokens_mistral': 1769, 'n_tokens_neox': 1700, 'n_words': 395}