def _connect(self, cmd, path):
        s = socket.socket(type=socket.SOCK_STREAM)
        s.connect((self._host, self._port))
        # -1 means system default buffering
        rfile = s.makefile('rb', -1)
        # 0 means unbuffered
        wfile = s.makefile('wb', 0)
        proto = Protocol(rfile.read, wfile.write,
                         report_activity=self._report_activity)
        proto.send_cmd('git-%s' % cmd, path, 'host=%s' % self._host)
        return proto, lambda: _fileno_can_read(s)
dataset/ETHPy150Open natestedman/Observatory/observatory/lib/dulwich/client.py/TCPGitClient._connect/original