<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rpc_error(id: Union[str, int], error_msg: str, warnings: List[Any] = []) -> rpcq.messages.RPCError: """ Create RPC error :param id: Request ID :param error_msg: Error message :param warning: List of warnings to attach to the message :return: JSON RPC formatted dict """

    return rpcq.messages.RPCError(
        jsonrpc='2.0',
        id=id,
        error=error_msg,
        warnings=[rpc_warning(warning) for warning in warnings])