<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def request(self, method, apikey, *args, **kwargs):
 """ Make a xml-rpc call to remote API. """

        dry_run = kwargs.get('dry_run', False)
        return_dry_run = kwargs.get('return_dry_run', False)
        if return_dry_run:
            args[-1]['--dry-run'] = True

        try:
            func = getattr(self.endpoint, method)
            return func(apikey, *args)
        except (socket.error, requests.exceptions.ConnectionError):
            msg = 'Gandi API service is unreachable'
            raise APICallFailed(msg)
        except xmlrpclib.Fault as err:
            msg = 'Gandi API has returned an error: %s' % err
            if dry_run:
                args[-1]['--dry-run'] = True
                ret = func(apikey, *args)
                raise DryRunException(msg, err.faultCode, ret)
            raise APICallFailed(msg, err.faultCode)
        except TypeError as err:
            msg = 'An unknown error has occurred: %s' % err
            raise APICallFailed(msg)