def _prepare_conn_args(self, kwargs):
        '''
        Set connection arguments for remote or local connection.
        '''
        kwargs['connect_over_uds'] = True
        kwargs['timeout'] = kwargs.get('timeout', 60)
        kwargs['cookie'] = kwargs.get('cookie', 'admin')
        if self._use_remote_connection(kwargs):
            kwargs['transport'] = kwargs.get('transport', 'https')
            if kwargs['transport'] == 'https':
                kwargs['port'] = kwargs.get('port', 443)
            else:
                kwargs['port'] = kwargs.get('port', 80)
            kwargs['verify'] = kwargs.get('verify', True)
            if isinstance(kwargs['verify'], bool):
                kwargs['verify_ssl'] = kwargs['verify']
            else:
                kwargs['ca_bundle'] = kwargs['verify']
            kwargs['connect_over_uds'] = False
        return kwargs
Set connection arguments for remote or local connection.