def dimensions_to_flat(dimensions):
  """Returns a flat '<key>:<value>' sorted list of dimensions."""
  out = []
  for k, values in dimensions.iteritems():
    for v in values:
      out.append('%s:%s' % (k, v))
  out.sort()
  return out