def dict_diff(a, b):
    """Returns the difference between two dictionaries.

    Parameters
    ----------
    a : dict
        The dictionary to prefer different results from.
    b : dict
        The dictionary to compare against.

    Returns
    -------
    dict
        A dictionary with only the different keys: values.
    """
    diff = {}

    for key in list(a.keys()):
        if key in b:
            if b[key] != a[key]:
                diff[key] = a[key]
        else:
            diff[key] = a[key]

    return diff