def PlaybookEntries2Dict(playbook):
  """Converts a playbook from list of dicts to dict of lists.

  Compiles all the values from each entry together.

  Args:
      playbook: A playbook in lookup table format.

  Returns:
      A playbook in dict of lists format.
  """

  output = {}
  for entry in playbook['entries']:
    for key, values in entry.iteritems():
      if key != 'lookup_loop_angle':
        if key not in output:
          output[key] = []
        output[key].append(values)

  # check if all lookup_loop_angles are the same, then copy
  for ii in range(len(playbook['entries']) - 1):
    assert (playbook['entries'][ii]['lookup_loop_angle']
            == playbook['entries'][ii-1]['lookup_loop_angle'])
  output['lookup_loop_angle'] = playbook['entries'][0]['lookup_loop_angle']

  return output