def merge_dictionaries(dictionaries):
    """ Merge a sequence of dictionaries safely.

    This function merges dictionaries together, but ensures that there are
    not same keys which point to different values. That is,
    merge_dictionaries({'alpha':True}, {'alpha':True}) is OK, but
    merge_dictionaries({'alpha':True}, {'alpha':False}) will raise an
    exception
    """

    res = {}
    for dct in dictionaries:
        for (k, v) in dct.iteritems():
            if k in res:
                assert res[k] == v
            res[k] = v
    return res