(domain, cases, last_sync_log)
return case_updates_to_sync
Given a domain, list of cases, and sync log representing the last
    sync, return a list of CaseSyncUpdate objects that should be applied
    to the next sync.
Given a domain, list of cases, and sync log representing the last
    sync, return a list of CaseSyncUpdate objects that should be applied
    to the next sync.
Given a domain list of cases and sync log representing the last sync return a list of CaseSyncUpdate objects that should be applied to the next sync .
def get_case_sync_updates(domain, cases, last_sync_log):
    """
    Given a domain, list of cases, and sync log representing the last
    sync, return a list of CaseSyncUpdate objects that should be applied
    to the next sync.
    """
    case_updates_to_sync = []

    def _approximate_domain_match(case):
        # if both objects have a domain then make sure they're the same, but if
        # either is empty then just assume it's a match (this is just for legacy tests)
        return domain == case.domain if domain and case.domain else True

    for case in cases:
        sync_update = CaseSyncUpdate(case, last_sync_log)
        if sync_update.required_updates and _approximate_domain_match(case):
            case_updates_to_sync.append(sync_update)

    return case_updates_to_sync
def get_case_sync_updates ( domain , cases , last_sync_log ) : case_updates_to_sync = [ ] def _approximate_domain_match ( case ) : # if both objects have a domain then make sure they're the same, but if # either is empty then just assume it's a match (this is just for legacy tests) return domain == case . domain if domain and case . domain else True for case in cases : sync_update = CaseSyncUpdate ( case , last_sync_log ) if sync_update . required_updates and _approximate_domain_match ( case ) : case_updates_to_sync . append ( sync_update ) return case_updates_to_sync