import random


def pick_random(template):
  """Given a template, pick randomly from it to create a clang config."""
  random.seed()
  result = {}
  for k, v in template.iteritems():
    if isinstance(v, dict):
      result[k] = pick_random(v)
    else:
      result[k] = random.choice(v)
  return result