<commit_before>import Foundation

class FDatabaseModelUser:FDatabaseModel
{
    let name:String
    let created:TimeInterval
    var rooms:[String]
    private let kEmptyString:String = ""
    private let kNonCreated:TimeInterval = 0
    
    enum Property:String
    {
        case name = "name"
        case created = "created"
        case rooms = "rooms"
    }
    
    init(name:String)
    {
        self.name = name
        created = NSDate().timeIntervalSince1970
        rooms = []
        
        super.init()
    }
    
    required init(snapshot:[String:Any])
    {
        let rawName:String? = snapshot[Property.name.rawValue] as? String
        let rawCreated:TimeInterval? = snapshot[Property.created.rawValue] as? TimeInterval
        let rawRooms:[String]? = snapshot[Property.rooms.rawValue] as? [String]
        
        if rawName == nil
        {
            name = kEmptyString
        }
        else
        {
            name = rawName!
        }
        
        if rawCreated == nil
        {
            created = kNonCreated
        }
        else
        {
            created = rawCreated!
        }
        
        if rawRooms == nil
        {
            rooms = []
        }
        else
        {
            rooms = rawRooms!
        }
        
        super.init()
    }

    override func modelJson() -> [String:Any]
    {
        let json:[String:Any] = [
            Property.name.rawValue:name,
            Property.created.rawValue:created,
            Property.rooms.rawValue:rooms
        ]
        
        return json
    }
}<commit_msg>Any for json<commit_after>import Foundation

class FDatabaseModelUser:FDatabaseModel
{
    let name:String
    let created:TimeInterval
    var rooms:[String]
    private let kEmptyString:String = ""
    private let kNonCreated:TimeInterval = 0
    
    enum Property:String
    {
        case name = "name"
        case created = "created"
        case rooms = "rooms"
    }
    
    init(name:String)
    {
        self.name = name
        created = NSDate().timeIntervalSince1970
        rooms = []
        
        super.init()
    }
    
    required init(snapshot:Any)
    {
        let snapshotDict:[String:Any]? = snapshot as? [String:Any]
        let rawName:String?
        let rawCreated:TimeInterval?
        let rawRooms:[String]?
        
        if snapshotDict == nil
        {
            rawName = nil
            rawCreated = nil
            rawRooms = nil
        }
        else
        {
            rawName = snapshotDict![Property.name.rawValue] as? String
            rawCreated = snapshotDict![Property.created.rawValue] as? TimeInterval
            rawRooms = snapshotDict![Property.rooms.rawValue] as? [String]
        }
        
        if rawName == nil
        {
            name = kEmptyString
        }
        else
        {
            name = rawName!
        }
        
        if rawCreated == nil
        {
            created = kNonCreated
        }
        else
        {
            created = rawCreated!
        }
        
        if rawRooms == nil
        {
            rooms = []
        }
        else
        {
            rooms = rawRooms!
        }
        
        super.init()
    }

    override func modelJson() -> Any
    {
        let json:[String:Any] = [
            Property.name.rawValue:name,
            Property.created.rawValue:created,
            Property.rooms.rawValue:rooms
        ]
        
        return json
    }
}
{'fraction_non_alphanumeric': 0.0858294930875576, 'fraction_numerical': 0.002880184331797235, 'mean_word_length': 1.3513879485443467, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2978840', 'n_tokens_mistral': 962, 'n_tokens_neox': 948, 'n_words': 194}