@staticmethod
    def parse_result(result):
        """Parse the data returned by the server according to the JSON-RPC spec. Try to be liberal in what we accept."""
        if not isinstance(result, dict):
            raise ProtocolError('Response is not a dictionary')
        if result.get('error'):
            code = result['error'].get('code', '')
            message = result['error'].get('message', '')
            raise ProtocolError(code, message, result)
        elif 'result' not in result:
            raise ProtocolError('Response without a result field')
        else:
            return result['result']
dataset/ETHPy150Open UniversalDevicesInc/Polyglot/polyglot/node_servers/kodi/jsonrpc_requests/jsonrpc.py/Server.parse_result/original