<commit_before>import Foundation

#if swift(>=4.0)
#elseif swift(>=3.0)
typealias BinaryInteger = Integer
#endif

extension PackProtocol {
    public func intValue() -> Int64? {
        if let i = self as? Int8 {
            return Int64(i)
        } else if let i = self as? Int16 {
            return Int64(i)
        } else if let i = self as? Int32 {
            return Int64(i)
        } else if let i = self as? Int64 {
            return i
        } else if let i = self as? UInt8 {
            return Int64(i)
        } else if let i = self as? UInt16 {
            return Int64(i)
        } else if let i = self as? UInt32 {
            return Int64(i)
        }

        return nil
    }

    public func uintValue() -> UInt64? {
        if let i = self as? UInt64 {
            return i
        } else if let i = self.intValue() {
            return UInt64(i)
        }

        return nil
    }
}

extension Int8: PackProtocol {
    struct Constants {
        static let byteMarker: Byte = 0xC8
    }

    public func pack() throws -> [Byte] {

        switch self {
        case -0x10 ... 0x7F:
            return packInt8(withByteMarker: false)
        default:
            return packInt8(withByteMarker: true)
        }
    }

    public static func unpack(_ bytes: ArraySlice<Byte>) throws -> Int8 {<commit_msg>Bugfix if uint conversion candidate was negative<commit_after>import Foundation

#if swift(>=4.0)
#elseif swift(>=3.0)
typealias BinaryInteger = Integer
#endif

extension PackProtocol {
    public func intValue() -> Int64? {
        if let i = self as? Int8 {
            return Int64(i)
        } else if let i = self as? Int16 {
            return Int64(i)
        } else if let i = self as? Int32 {
            return Int64(i)
        } else if let i = self as? Int64 {
            return i
        } else if let i = self as? UInt8 {
            return Int64(i)
        } else if let i = self as? UInt16 {
            return Int64(i)
        } else if let i = self as? UInt32 {
            return Int64(i)
        }

        return nil
    }

    public func uintValue() -> UInt64? {
        if let i = self as? UInt64 {
            return i
        } else if let i = self.intValue() {
            if i < 0 {
                return nil
            } else {
                return UInt64(i)
            }
        }

        return nil
    }
}

extension Int8: PackProtocol {
    struct Constants {
        static let byteMarker: Byte = 0xC8
    }

    public func pack() throws -> [Byte] {

        switch self {
        case -0x10 ... 0x7F:
            return packInt8(withByteMarker: false)
        default:
            return packInt8(withByteMarker: true)
        }
    }

    public static func unpack(_ bytes: ArraySlice<Byte>) throws -> Int8 {
{'fraction_non_alphanumeric': 0.08884892086330935, 'fraction_numerical': 0.0341726618705036, 'mean_word_length': 1.5190217391304348, 'pattern_counts': {'":': 0, '<': 6, '<?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': '62842', 'n_tokens_mistral': 883, 'n_tokens_neox': 828, 'n_words': 284}