'Generates a sync result.
Args:
sync_config (SyncConfig)
since_token (StreamToken)
full_state (bool)
Returns:
Deferred(SyncResult)'

@defer.inlineCallbacks
def generate_sync_result(self, sync_config, since_token=None, full_state=False):

    logger.info('Calculating    sync    response    for    %r', sync_config.user)
    now_token = (yield self.event_sources.get_current_token())
    sync_result_builder = SyncResultBuilder(sync_config, full_state, since_token=since_token, now_token=now_token)
    account_data_by_room = (yield self._generate_sync_entry_for_account_data(sync_result_builder))
    res = (yield self._generate_sync_entry_for_rooms(sync_result_builder, account_data_by_room))
    (newly_joined_rooms, newly_joined_users) = res
    block_all_presence_data = ((since_token is None) and sync_config.filter_collection.blocks_all_presence())
    if (not block_all_presence_data):
        (yield self._generate_sync_entry_for_presence(sync_result_builder, newly_joined_rooms, newly_joined_users))
    (yield self._generate_sync_entry_for_to_device(sync_result_builder))
    device_lists = (yield self._generate_sync_entry_for_device_list(sync_result_builder))
    device_id = sync_config.device_id
    one_time_key_counts = {}
    if device_id:
        user_id = sync_config.user.to_string()
        one_time_key_counts = (yield self.store.count_e2e_one_time_keys(user_id, device_id))
    defer.returnValue(SyncResult(presence=sync_result_builder.presence, account_data=sync_result_builder.account_data, joined=sync_result_builder.joined, invited=sync_result_builder.invited, archived=sync_result_builder.archived, to_device=sync_result_builder.to_device, device_lists=device_lists, device_one_time_keys_count=one_time_key_counts, next_batch=sync_result_builder.now_token))
