<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sync(self, api_token, sync_token, resource_types='["all"]', **kwargs):
 """Update and retrieve Todoist data. :param api_token: The user's login api_token. :type api_token: str :param seq_no: The request sequence number. On initial request pass ``0``. On all others pass the last seq_no you received. :type seq_no: int :param seq_no_global: The request sequence number. On initial request pass ``0``. On all others pass the last seq_no you received. :type seq_no_global: int :param resource_types: Specifies which subset of data you want to receive e.g. only projects. Defaults to all data. :type resources_types: str :param commands: A list of JSON commands to perform. :type commands: list (str) :return: The HTTP response to the request. :rtype: :class:`requests.Response` """

        params = {
            'token': api_token,
            'sync_token': sync_token,
        }
        req_func = self._post
        if 'commands' not in kwargs:  # GET if we're not changing data.
            req_func = self._get
            params['resource_types'] = resource_types
        return req_func('sync', params, **kwargs)