<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def new_netting_channel( self, partner: Address, settle_timeout: int, given_block_identifier: BlockSpecification, ) -> ChannelID: """ Creates a new channel in the TokenNetwork contract. Args: partner: The peer to open the channel with. settle_timeout: The settle timeout to use for this channel. given_block_identifier: The block identifier of the state change that prompted this proxy action Returns: The ChannelID of the new netting channel. """

        checking_block = self.client.get_checking_block()
        self._new_channel_preconditions(
            partner=partner,
            settle_timeout=settle_timeout,
            block_identifier=given_block_identifier,
        )
        log_details = {
            'peer1': pex(self.node_address),
            'peer2': pex(partner),
        }
        gas_limit = self.proxy.estimate_gas(
            checking_block,
            'openChannel',
            participant1=self.node_address,
            participant2=partner,
            settle_timeout=settle_timeout,
        )
        if not gas_limit:
            self.proxy.jsonrpc_client.check_for_insufficient_eth(
                transaction_name='openChannel',
                transaction_executed=False,
                required_gas=GAS_REQUIRED_FOR_OPEN_CHANNEL,
                block_identifier=checking_block,
            )
            self._new_channel_postconditions(
                partner=partner,
                block=checking_block,
            )

            log.critical('new_netting_channel call will fail', **log_details)
            raise RaidenUnrecoverableError('Creating a new channel will fail')

        log.debug('new_netting_channel called', **log_details)
        # Prevent concurrent attempts to open a channel with the same token and
        # partner address.
        if gas_limit and partner not in self.open_channel_transactions:
            new_open_channel_transaction = AsyncResult()
            self.open_channel_transactions[partner] = new_open_channel_transaction
            gas_limit = safe_gas_limit(gas_limit, GAS_REQUIRED_FOR_OPEN_CHANNEL)
            try:
                transaction_hash = self.proxy.transact(
                    'openChannel',
                    gas_limit,
                    participant1=self.node_address,
                    participant2=partner,
                    settle_timeout=settle_timeout,
                )
                self.client.poll(transaction_hash)
                receipt_or_none = check_transaction_threw(self.client, transaction_hash)
                if receipt_or_none:
                    self._new_channel_postconditions(
                        partner=partner,
                        block=receipt_or_none['blockNumber'],
                    )
                    log.critical('new_netting_channel failed', **log_details)
                    raise RaidenUnrecoverableError('creating new channel failed')

            except Exception as e:
                log.critical('new_netting_channel failed', **log_details)
                new_open_channel_transaction.set_exception(e)
                raise
            else:
                new_open_channel_transaction.set(transaction_hash)
            finally:
                self.open_channel_transactions.pop(partner, None)
        else:
            # All other concurrent threads should block on the result of opening this channel
            self.open_channel_transactions[partner].get()

        channel_identifier: ChannelID = self._detail_channel(
            participant1=self.node_address,
            participant2=partner,
            block_identifier='latest',
        ).channel_identifier
        log_details['channel_identifier'] = str(channel_identifier)
        log.info('new_netting_channel successful', **log_details)

        return channel_identifier