def merge(local, base, remote, check_modified=False):
    """Generate unmerged series of changes (including conflicts).

    By diffing the two diffs, we find *changes* that are
    on the local branch, the remote branch, or both.
    We arbitrarily choose the "local" branch to be the "before"
    and the "remote" branch to be the "after" in the diff algorithm.

    Therefore:
    If a change is "deleted", that means that it occurs only on
    the local branch. If a change is "added" that means it occurs only on
    the remote branch. If a change is "unchanged", that means it occurs
    in both branches. Either the same addition or same deletion occurred in
    both branches, or the cell was not changed in either branch.

    Parameters
    ----------
    local : list
        A sequence representing the items on the local branch.
    base : dict
        A sequence representing the items on the base branch
    remote : dict
        A sequence representing the items on the remote branch.

    Returns
    -------
    result : A diff result comparing the changes on the local and remote
             branches.
    """
    base_local = diff.diff(base, local, check_modified=check_modified)
    base_remote = diff.diff(base, remote, check_modified=check_modified)
    merge = diff.diff(base_local, base_remote)
    return merge
Generate unmerged series of changes (including conflicts).

    By diffing the two diffs, we find *changes* that are
    on the local branch, the remote branch, or both.
    We arbitrarily choose the "local" branch to be the "before"
    and the "remote" branch to be the "after" in the diff algorithm.

    Therefore:
    If a change is "deleted", that means that it occurs only on
    the local branch. If a change is "added" that means it occurs only on
    the remote branch. If a change is "unchanged", that means it occurs
    in both branches. Either the same addition or same deletion occurred in
    both branches, or the cell was not changed in either branch.

    Parameters
    ----------
    local : list
        A sequence representing the items on the local branch.
    base : dict
        A sequence representing the items on the base branch
    remote : dict
        A sequence representing the items on the remote branch.

    Returns
    -------
    result : A diff result comparing the changes on the local and remote
             branches.