def read_status(self):
        request = Connection()
        request.write_varint(0)  # Request status
        self.connection.write_buffer(request)

        response = self.connection.read_buffer()
        if response.read_varint() != 0:
            raise IOError("Received invalid status response packet.")
        try:
            raw = json.loads(response.read_utf())
        except ValueError:
            raise IOError("Received invalid JSON")
        try:
            return PingResponse(raw)
        except __HOLE__ as e:
            raise IOError("Received invalid status response: %s" % e)
dataset/ETHPy150Open Dinnerbone/mcstatus/mcstatus/pinger.py/ServerPinger.read_status