def flatten_config(config):
    """Take dict with ':'-separated keys and values or tuples of values,
    flattening to single key-value pairs.

    Example: _flatten_config({'a:b': (1, 2), 'c': 3}) -> {'a: 1, 'b': 2, 'c': 3}."""
    new_config = {}
    for ks, vs in config.items():
        ks = ks.split(":")
        if len(ks) == 1:
            vs = (vs,)

        for k, v in zip(ks, vs):
            assert k not in new_config, f"duplicate key '{k}'"
            new_config[k] = v

    return new_config