<commit_before>import JSON

public enum Json {
    case null
    case bool(Bool)
    case double(Double)
    case int(Int)
    case string(String)
    case array([Json])
    case object([String: Json])

    public init(_ value: JSON) {
        switch value {
        case .nullValue:
            self = .null
        case .booleanValue(let bool):
            self = .bool(bool)
        case .numberValue(let number):
            if floor(number) == number {
                self = .int(Int(number))
            } else {
                self = .double(number)
            }
        case .stringValue(let string):
            self = .string(string)
        case .objectValue(let object):
            var mapped: [String: Json] = [:]
            object.forEach { (key, value) in
                mapped[key] = Json(value)
            }
            self = .object(mapped)
        case .arrayValue(let array):
            let mapped: [Json] = array.map { item in
                return Json(item)
            }

            self = .array(mapped)
        }
    }

    public init(_ value: Bool) {
        self = .bool(value)
    }

    public init(_ value: Double) {
        self = .double(value)
    }

    public init(_ value: Int) {
        self = .int(value)
    }

    public init(_ value: String) {
        self = .string(value)
    }

    public init(_ value: [JsonRepresentable]) {
        let array: [Json] = value.map { item in
            return item.makeJson()
        }
        self = .array(array)
    }

    public init(_ value: [String: JsonRepresentable]) {
        var object: [String: Json] = [:]

        value.forEach { (key, item) in
            object[key] = item.makeJson()
        }

        self = .object(object)
    }

    public init(_ value: Data) throws {
        let json = try JSONParser().parse(value)
        self.init(json)
    }

    public var data: Data {
        return JSONSerializer().serialize(makeZewoJson())
    }

    private func makeZewoJson() -> JSON {
        switch self {
        case .null:
            return .nullValue
        case .bool(let bool):
            return .booleanValue(bool)
        case .int(let int):<commit_msg>json update<commit_after>import JSON

public enum Json {
    case null
    case bool(Bool)
    case double(Double)
    case int(Int)
    case string(String)
    case array([Json])
    case object([String: Json])

    public init(_ value: JSON) {
        switch value {
        case .nullValue:
            self = .null
        case .booleanValue(let bool):
            self = .bool(bool)
        case .numberValue(let number):
            if floor(number) == number {
                self = .int(Int(number))
            } else {
                self = .double(number)
            }
        case .stringValue(let string):
            self = .string(string)
        case .objectValue(let object):
            var mapped: [String: Json] = [:]
            object.forEach { (key, value) in
                mapped[key] = Json(value)
            }
            self = .object(mapped)
        case .arrayValue(let array):
            let mapped: [Json] = array.map { item in
                return Json(item)
            }

            self = .array(mapped)
        }
    }

    public init(_ value: Bool) {
        self = .bool(value)
    }

    public init(_ value: Double) {
        self = .double(value)
    }

    public init(_ value: Int) {
        self = .int(value)
    }

    public init(_ value: String) {
        self = .string(value)
    }

    public init(_ value: [JsonRepresentable]) {
        let array: [Json] = value.map { item in
            return item.makeJson()
        }
        self = .array(array)
    }

    public init(_ value: [String: JsonRepresentable]) {
        var object: [String: Json] = [:]

        value.forEach { (key, item) in
            object[key] = item.makeJson()
        }

        self = .object(object)
    }

    public init(_ value: Data) throws {
        let json = try JSONParser().parse(data: value)
        self.init(json)
    }

    public var data: Data {
        return JSONSerializer().serialize(json: makeZewoJson())
    }

    private func makeZewoJson() -> JSON {
        switch self {
        case .null:
            return .nullValue
        case .bool(let bool):
            return .booleanValue(bool)
        case .int(let int):
{'fraction_non_alphanumeric': 0.11376146788990826, 'fraction_numerical': 0.0, 'mean_word_length': 1.5473130841121496, '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': '6247937', 'n_tokens_mistral': 1272, 'n_tokens_neox': 1225, 'n_words': 338}