def sync(self, commands=None, **kwargs):
        data = {
            'token': self.token,
            'commands': json.dumps(commands or [], separators=',:',
                                   default=self._json_serializer),
            'day_orders_timestamp': self.state['DayOrdersTimestamp'],
        }
        if not commands:
            data['seq_no'], data['seq_no_global'] = \
                self._get_seq_no(kwargs.get('resource_types', None))

        if 'include_notification_settings' in kwargs:
            data['include_notification_settings'] = 1
        if 'resource_types' in kwargs:
            data['resource_types'] = json.dumps(kwargs['resource_types'],
                                                separators=',:')
        data = self._post('sync', data=data)
        self._update_state(data)
        if not commands:
            self._update_seq_no(data.get('seq_no', None),
                                data.get('seq_no_global', None),
                                kwargs.get('resource_types', None))

        return data
Sends to the server the changes that were made locally, and also
dataset/ETHPy150Open Doist/todoist-python/todoist/api.py/TodoistAPI.sync