def join_sequence_of_dicts(seq):
    """
    Joins a sequence of dicts into a single dict

    Parameters
    ----------
    seq: sequence
        Sequence of dicts to join

    Returns
    -------
    dict

    Raises
    ------
    RuntimeError if a duplicate key is encountered.
    """
    r = {}
    for d in seq:
        for k, v in d.items():
            if k in r:
                raise RuntimeError(
                    'Duplicate key %r (new value: %r, was: %r)' % (k, v, r[k]))
            r[k] = v
    return r
