def values_dict(items):
    """Given a list of (key, list) values returns a dictionary where
    single-element lists have been replaced by their sole value.
    """
    return {k: v[0] if len(v) == 1 else v for k, v in items}