<commit_before>import UIKit

final class VCreateStatusReadyBarTravel:
    VCollection<
    ArchCreate,
    VCreateStatusReadyBarTravelCell>
{
    private let kHeaderHeight:CGFloat = 45
    private var cellSize:CGSize?
    private let headerSize:CGSize
    private let kCellHeight:CGFloat = 50
    
    var model:[DPlanTravel]?
    {
        get
        {
            return controller.model.plan?.plan.travels?.array as? [
                DPlanTravel]
        }
    }
    
    required init(controller:CCreate)
    {
        headerSize = CGSize(
            width:0,
            height:kHeaderHeight)
        
        super.init(controller:controller)
        config()
    }
    
    required init?(coder:NSCoder)
    {
        return nil
    }
    
    override func collectionView(
        _ collectionView:UICollectionView,
        layout collectionViewLayout:UICollectionViewLayout,
        referenceSizeForHeaderInSection section:Int) -> CGSize
    {
        guard
        
            let countStops:Int = controller.model.plan?.plan.stops?.count,
            countStops > 0
        
        else
        {
            return CGSize.zero
        }
        
        return headerSize
    }
    
    override func collectionView(
        _ collectionView:UICollectionView,
        layout collectionViewLayout:UICollectionViewLayout,
        sizeForItemAt indexPath:IndexPath) -> CGSize
    {
        guard
            
            let cellSize:CGSize = self.cellSize
            
        else
        {
            let width:CGFloat = collectionView.bounds.width
            let cellSize:CGSize = CGSize(
                width:width,
                height:kCellHeight)
            self.cellSize = cellSize
            
            return cellSize
        }
        
        return cellSize
    }
    
    override func collectionView(
        _ collectionView:UICollectionView,
        numberOfItemsInSection section:Int) -> Int
    {
        guard
            
            let count:Int = self.model?.count
            
        else
        {
            return 0
        }
        
        return count
    }
    
    override func collectionView(
        _ collectionView:UICollectionView,
        viewForSupplementaryElementOfKind kind:String,
        at indexPath:IndexPath) -> UICollectionReusableView
    {
        let reusable:VCreateStatusReadyBarTravelHeader = reusableAtIndex(
            kind:kind,
            indexPath:indexPath)
        
        return reusable
    }
    
    override func collectionView(
        _ collectionView:UICollectionView,
        cellForItemAt indexPath:IndexPath) -> UICollectionViewCell
    {
        let item:DPlanTravel = modelAtIndex(
            index:indexPath)
        let cell:VCreateStatusReadyBarTravelCell = cellAtIndex(
            indexPath:indexPath)
        
        cell.config(
            controller:controller,
            model:item)
        
        return cell
    }
    
    override func collectionView(
        _ collectionView:UICollectionView,
        didSelectItemAt indexPath:IndexPath)
    {
        super.collectionView(
            collectionView,
            didSelectItemAt:indexPath)
        
        let item:DPlanTravel = modelAtIndex(
            index:indexPath)
        controller.editTrave(travel:item)
    }
}
<commit_msg>Fix trave typo<commit_after>import UIKit

final class VCreateStatusReadyBarTravel:
    VCollection<
    ArchCreate,
    VCreateStatusReadyBarTravelCell>
{
    private let kHeaderHeight:CGFloat = 45
    private var cellSize:CGSize?
    private let headerSize:CGSize
    private let kCellHeight:CGFloat = 50
    
    var model:[DPlanTravel]?
    {
        get
        {
            return controller.model.plan?.plan.travels?.array as? [
                DPlanTravel]
        }
    }
    
    required init(controller:CCreate)
    {
        headerSize = CGSize(
            width:0,
            height:kHeaderHeight)
        
        super.init(controller:controller)
        config()
    }
    
    required init?(coder:NSCoder)
    {
        return nil
    }
    
    override func collectionView(
        _ collectionView:UICollectionView,
        layout collectionViewLayout:UICollectionViewLayout,
        referenceSizeForHeaderInSection section:Int) -> CGSize
    {
        guard
        
            let countStops:Int = controller.model.plan?.plan.stops?.count,
            countStops > 0
        
        else
        {
            return CGSize.zero
        }
        
        return headerSize
    }
    
    override func collectionView(
        _ collectionView:UICollectionView,
        layout collectionViewLayout:UICollectionViewLayout,
        sizeForItemAt indexPath:IndexPath) -> CGSize
    {
        guard
            
            let cellSize:CGSize = self.cellSize
            
        else
        {
            let width:CGFloat = collectionView.bounds.width
            let cellSize:CGSize = CGSize(
                width:width,
                height:kCellHeight)
            self.cellSize = cellSize
            
            return cellSize
        }
        
        return cellSize
    }
    
    override func collectionView(
        _ collectionView:UICollectionView,
        numberOfItemsInSection section:Int) -> Int
    {
        guard
            
            let count:Int = self.model?.count
            
        else
        {
            return 0
        }
        
        return count
    }
    
    override func collectionView(
        _ collectionView:UICollectionView,
        viewForSupplementaryElementOfKind kind:String,
        at indexPath:IndexPath) -> UICollectionReusableView
    {
        let reusable:VCreateStatusReadyBarTravelHeader = reusableAtIndex(
            kind:kind,
            indexPath:indexPath)
        
        return reusable
    }
    
    override func collectionView(
        _ collectionView:UICollectionView,
        cellForItemAt indexPath:IndexPath) -> UICollectionViewCell
    {
        let item:DPlanTravel = modelAtIndex(
            index:indexPath)
        let cell:VCreateStatusReadyBarTravelCell = cellAtIndex(
            indexPath:indexPath)
        
        cell.config(
            controller:controller,
            model:item)
        
        return cell
    }
    
    override func collectionView(
        _ collectionView:UICollectionView,
        didSelectItemAt indexPath:IndexPath)
    {
        super.collectionView(
            collectionView,
            didSelectItemAt:indexPath)
        
        let item:DPlanTravel = modelAtIndex(
            index:indexPath)
        controller.editTravel(travel:item)
    }
}

{'fraction_non_alphanumeric': 0.05763427881713941, 'fraction_numerical': 0.002112251056125528, 'mean_word_length': 1.6441962504986039, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '4818380', 'n_tokens_mistral': 1767, 'n_tokens_neox': 1727, 'n_words': 312}