<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def reload(self):
 """ Refreshes the resource with the data from the server. """

        try:
            if hasattr(self, 'href'):
                data = self._api.get(self.href, append_base=False).json()
                resource = self.__class__(api=self._api, **data)
            elif hasattr(self, 'id') and hasattr(self, '_URL') and \
                    'get' in self._URL:
                data = self._api.get(
                    self._URL['get'].format(id=self.id)).json()
                resource = self.__class__(api=self._api, **data)
            else:
                raise SbgError('Resource can not be refreshed!')

            query = {'id': self.id} if hasattr(self, 'id') else {}
            extra = {'resource': self.__class__.__name__, 'query': query}
            logger.info('Reloading {} resource.'.format(self), extra=extra)

        except Exception:
            raise SbgError('Resource can not be refreshed!')

        self._data = resource._data
        self._dirty = resource._dirty
        self._old = copy.deepcopy(self._data.data)
        return self