(device_id, podcast_states, since, until)
return add, rem
returns subscription changes for the device and podcast states
returns subscription changes for the device and podcast states
returns subscription changes for the device and podcast states
def subscription_changes(device_id, podcast_states, since, until):
    """returns subscription changes for the device and podcast states"""

    add, rem = [], []
    for p_state in podcast_states:
        change = p_state.get_change_between(device_id, since, until)
        if change == "subscribe":
            add.append(p_state.ref_url)
        elif change == "unsubscribe":
            rem.append(p_state.ref_url)

    return add, rem
def subscription_changes ( device_id , podcast_states , since , until ) : add , rem = [ ] , [ ] for p_state in podcast_states : change = p_state . get_change_between ( device_id , since , until ) if change == "subscribe" : add . append ( p_state . ref_url ) elif change == "unsubscribe" : rem . append ( p_state . ref_url ) return add , rem