<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_token_network_identifiers( chain_state: ChainState, payment_network_id: PaymentNetworkID, ) -> List[TokenNetworkID]: """ Return the list of token networks registered with the given payment network. """

    payment_network = chain_state.identifiers_to_paymentnetworks.get(payment_network_id)

    if payment_network is not None:
        return [
            token_network.address
            for token_network in payment_network.tokenidentifiers_to_tokennetworks.values()
        ]

    return list()