<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def send_to_device(self, event_type, messages, txn_id=None):
 """Sends send-to-device events to a set of client devices. Args: event_type (str):
 The type of event to send. messages (dict):
 The messages to send. Format should be <user_id>: {<device_id>: <event_content>}. The device ID may also be '*', meaning all known devices for the user. txn_id (str):
 Optional. The transaction ID for this event, will be generated automatically otherwise. """

        txn_id = txn_id if txn_id else self._make_txn_id()
        return self._send(
            "PUT",
            "/sendToDevice/{}/{}".format(event_type, txn_id),
            content={"messages": messages}
        )