<commit_before>#import "TSTLSoundCollectionViewController.h"
#import "TSTLSound.h"
#import "TSTLSoundHeadComponent.h"
#import "TSTLSoundHeadComponent.h"
#import "CKCollectionViewDataSource.h"
#import <ComponentKit/CKComponentProvider.h>
#import <ComponentKit/CKComponentFlexibleSizeRangeProvider.h>

@interface TSTLSoundCollectionViewController () <CKComponentProvider>
@end

@implementation TSTLSoundCollectionViewController {
    CKCollectionViewDataSource *_dataSource;
    CKComponentFlexibleSizeRangeProvider *_sizeRangeProvider;
}

- (instancetype)initWithCollectionViewLayout:(UICollectionViewLayout *)layout {
    if (self = [super initWithCollectionViewLayout:layout]) {
        _sizeRangeProvider = [CKComponentFlexibleSizeRangeProvider providerWithFlexibility:CKComponentSizeRangeFlexibleHeight];
        self.title = @"le titre";
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];

    _dataSource = [[CKCollectionViewDataSource alloc] initWithCollectionView:self.collectionView
                                                 supplementaryViewDataSource:nil
                                                           componentProvider:self.class
                                                                     context:nil
                                                   cellConfigurationFunction:nil];
    CKArrayControllerSections sections;
    sections.insert(0);
    [_dataSource enqueueChangeset:{sections, {}} constrainedSize:{}];

    NSArray *sounds = @[
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init]
    ];

    CKArrayControllerInputItems items;
    for (NSUInteger i = 0; i < [sounds count]; ++i) {
        items.insert([NSIndexPath indexPathForRow:i inSection:0], sounds[i]);
    }

    [_dataSource enqueueChangeset:{{}, items}
                  constrainedSize:[_sizeRangeProvider sizeRangeForBoundingSize:self.collectionView.bounds.size]];
}

+ (CKComponent *)componentForModel:(id <NSObject>)model context:(id <NSObject>)context {
    return [TSTLSoundHeadComponent newWithSound:(TSTLSound *) model];
}

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)layout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
    return [_dataSource sizeForItemAtIndexPath:indexPath];
}

@end<commit_msg>fix: use SoundComponent instead SoundHeadComponent in view controller<commit_after>#import "TSTLSoundCollectionViewController.h"
#import "TSTLSound.h"
#import "TSTLSoundHeadComponent.h"
#import "TSTLSoundHeadComponent.h"
#import "CKCollectionViewDataSource.h"
#import "TSTLSoundComponent.h"
#import <ComponentKit/CKComponentProvider.h>
#import <ComponentKit/CKComponentFlexibleSizeRangeProvider.h>

@interface TSTLSoundCollectionViewController () <CKComponentProvider>
@end

@implementation TSTLSoundCollectionViewController {
    CKCollectionViewDataSource *_dataSource;
    CKComponentFlexibleSizeRangeProvider *_sizeRangeProvider;
}

- (instancetype)initWithCollectionViewLayout:(UICollectionViewLayout *)layout {
    if (self = [super initWithCollectionViewLayout:layout]) {
        _sizeRangeProvider = [CKComponentFlexibleSizeRangeProvider providerWithFlexibility:CKComponentSizeRangeFlexibleHeight];
        self.title = @"le titre";
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];

    _dataSource = [[CKCollectionViewDataSource alloc] initWithCollectionView:self.collectionView
                                                 supplementaryViewDataSource:nil
                                                           componentProvider:self.class
                                                                     context:nil
                                                   cellConfigurationFunction:nil];
    CKArrayControllerSections sections;
    sections.insert(0);
    [_dataSource enqueueChangeset:{sections, {}} constrainedSize:{}];

    NSArray *sounds = @[
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init],
            [[TSTLSound alloc] init]
    ];

    CKArrayControllerInputItems items;
    for (NSUInteger i = 0; i < [sounds count]; ++i) {
        items.insert([NSIndexPath indexPathForRow:i inSection:0], sounds[i]);
    }

    [_dataSource enqueueChangeset:{{}, items}
                  constrainedSize:[_sizeRangeProvider sizeRangeForBoundingSize:self.collectionView.bounds.size]];
}

+ (CKComponent *)componentForModel:(id <NSObject>)model context:(id <NSObject>)context {
    return [TSTLSoundComponent newWithSound:(TSTLSound *) model];
}

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)layout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
    return [_dataSource sizeForItemAtIndexPath:indexPath];
}

@end
{'fraction_non_alphanumeric': 0.10655630009197214, 'fraction_numerical': 0.0007883326763894363, 'mean_word_length': 2.452154195011338, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1218189', 'n_tokens_mistral': 2099, 'n_tokens_neox': 2024, 'n_words': 438}