import six


def _unify_col_values(col_values, count):
  """
  Helper that converts a dict mapping keys to values or lists of values to all lists. Non-list
  values get turned into lists by repeating them count times.
  """
  assert all(len(v) == count for v in six.itervalues(col_values) if isinstance(v, list))
  return {k: (v if isinstance(v, list) else [v] * count)
          for k, v in six.iteritems(col_values)}