<commit_before>import Foundation

class AdapterSocket : NSObject, SocketProtocol, RawSocketDelegate {
    var socket: RawSocketProtocol!
    var request: ConnectRequest!
    var response: ConnectResponse = ConnectResponse()
    weak var delegate: SocketDelegate?
    var delegateQueue: dispatch_queue_t! {
        didSet {
            socket?.delegateQueue = delegateQueue
        }
    }
    
    var state: SocketStatus = .Invalid
    
    func openSocketWithRequest(request: ConnectRequest) {
        self.request = request
        socket.delegate = self
        socket.delegateQueue = delegateQueue
        state = .Connecting
    }
    
    func writeData(data: NSData, withTag tag: Int = 0) {
        socket.writeData(data, withTag: tag)
    }
    
    func readDataWithTag(tag: Int = 0) {
        socket.readDataWithTag(tag)
    }

    // MARK: SocketDelegate protocol implemention
    func didDisconnect(socket: RawSocketProtocol) {
        state = .Closed
        delegate?.didDisconnect(self)
    }
    
    func didReadData(data: NSData, withTag tag: Int, from: RawSocketProtocol) {
        delegate?.didReadData(data, withTag: tag, from: self)
    }
    
    func didWriteData(data: NSData?, withTag tag: Int, from: RawSocketProtocol) {
        delegate?.didWriteData(data, withTag: tag, from: self)
    }
    
    func didConnect(socket: RawSocketProtocol) {
        state = .Established
        let response = ConnectResponse()
        delegate?.didConnect(self, withResponse: response)
    }
}<commit_msg>Fix adapter do not return correct response<commit_after>import Foundation

class AdapterSocket : NSObject, SocketProtocol, RawSocketDelegate {
    var socket: RawSocketProtocol!
    var request: ConnectRequest!
    var response: ConnectResponse = ConnectResponse()
    weak var delegate: SocketDelegate?
    var delegateQueue: dispatch_queue_t! {
        didSet {
            socket?.delegateQueue = delegateQueue
        }
    }
    
    var state: SocketStatus = .Invalid
    
    func openSocketWithRequest(request: ConnectRequest) {
        self.request = request
        socket.delegate = self
        socket.delegateQueue = delegateQueue
        state = .Connecting
    }
    
    func writeData(data: NSData, withTag tag: Int = 0) {
        socket.writeData(data, withTag: tag)
    }
    
    func readDataWithTag(tag: Int = 0) {
        socket.readDataWithTag(tag)
    }

    // MARK: SocketDelegate protocol implemention
    func didDisconnect(socket: RawSocketProtocol) {
        state = .Closed
        delegate?.didDisconnect(self)
    }
    
    func didReadData(data: NSData, withTag tag: Int, from: RawSocketProtocol) {
        delegate?.didReadData(data, withTag: tag, from: self)
    }
    
    func didWriteData(data: NSData?, withTag tag: Int, from: RawSocketProtocol) {
        delegate?.didWriteData(data, withTag: tag, from: self)
    }
    
    func didConnect(socket: RawSocketProtocol) {
        state = .Established
        delegate?.didConnect(self, withResponse: response)
    }
}
{'fraction_non_alphanumeric': 0.08487450462351387, 'fraction_numerical': 0.001321003963011889, 'mean_word_length': 2.716564417177914, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1985133', 'n_tokens_mistral': 855, 'n_tokens_neox': 843, 'n_words': 211}