<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def broadcast_tx(self, tx):
 """ broadcast a transaction to the network """

        url = self.base_url("txs/push")
        data = {"tx": tx.as_hex()}
        result = json.loads(urlopen(url, data=json.dumps(data)).read().decode("utf8"))
        return result