human
Complete this python program:
def fuse_selections(dsk, head1, head2, merge):
assistant
#Here is the Python program you requested.

    """Fuse selections with lower operation.
    Handles graphs of the form:
    ``{key1: (head1, key2, ...), key2: (head2, ...)}``
    Parameters
    dsk : dict
    dask graph
    head1 : function
    The first element of task1
    head2 : function
    The first element of task2
    merge : function
    Takes ``task1`` and ``task2`` and returns a merged task to
    replace ``task1``.
    Examples
    >>> def load(store, partition, columns):
    ...     pass
    >>> dsk = {\x\: (load, \store\, \part\, [\a\, \b\]),
    ...        \y\: (getitem, \x\, \a\)}
    >>> merge = lambda t1, t2: (load, t2[1], t2[2], t1[2])
    >>> dsk2 = fuse_selections(dsk, getitem, load, merge)
    >>> cull(dsk2, \y\)[0]
    {\y\: (<function load at ...>, \store\, \part\, \a\)}
    """
    dsk2 = dict()
    for (k, v) in dsk.items():
        try:
            if (istask(v) and (v[0] == head1) and (v[1] in dsk) and istask(dsk[v[1]]) and (dsk[v[1]][0] == head2)):
                dsk2[k] = merge(v, dsk[v[1]])
            else:
                dsk2[k] = v
        except TypeError:
            dsk2[k] = v
    return dsk2