<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_network_id(network_id, web3: Web3):
 """ Check periodically if the underlying ethereum client's network id has changed"""

    while True:
        current_id = int(web3.version.network)
        if network_id != current_id:
            raise RuntimeError(
                f'Raiden was running on network with id {network_id} and it detected '
                f'that the underlying ethereum client network id changed to {current_id}.'
                f' Changing the underlying blockchain while the Raiden node is running '
                f'is not supported.',
            )
        gevent.sleep(CHECK_NETWORK_ID_INTERVAL)