def to_result(self, iface_name, func_name, resp):
        """
        Takes a JSON-RPC response and checks for an "error" slot. If it exists,
        a RpcException is raised.  If no "error" slot exists, the "result" slot is
        returned.

        If validate_response==True on the Client constructor, the result is validated
        against the expected return type for the function and a RpcException raised if it is
        invalid.

        :Parameters:
          iface_name
            Interface name that was called
          func_name
            Function that was called on the interface
          resp
            Dict formatted as a JSON-RPC response
        """
        if "error" in resp:
            e = resp["error"]
            data = None
            if e in "data":
                data = e["data"]
            raise RpcException(e["code"], e["message"], data)

        result = resp["result"]

        if self.validate_resp:
            self.contract.validate_response(iface_name, func_name, result)
        return result
dataset/ETHPy150Open StackHut/stackhut/stackhut_toolkit/common/barrister/runtime.py/Client.to_result/swapped operands of `in`