<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _join_partner(self, partner: Address):
 """ Ensure a channel exists with partner and is funded in our side """

        try:
            self.api.channel_open(
                self.registry_address,
                self.token_address,
                partner,
            )
        except DuplicatedChannelError:
            # If channel already exists (either because partner created it,
            # or it's nonfunded channel), continue to ensure it's funded
            pass

        total_deposit = self._initial_funding_per_partner
        if total_deposit == 0:
            return

        try:
            self.api.set_total_channel_deposit(
                registry_address=self.registry_address,
                token_address=self.token_address,
                partner_address=partner,
                total_deposit=total_deposit,
            )
        except InvalidDBData:
            raise
        except RECOVERABLE_ERRORS:
            log.info(
                'Deposit failed',
                node=pex(self.raiden.address),
                partner=pex(partner),
            )
        except RaidenUnrecoverableError:
            should_crash = (
                self.raiden.config['environment_type'] != Environment.PRODUCTION or
                self.raiden.config['unrecoverable_error_should_crash']
            )
            if should_crash:
                raise

            log.critical(
                'Deposit failed',
                node=pex(self.raiden.address),
                partner=pex(partner),
            )