Given package and map config:(type,value), set selections

def debconf_set_selections(package, selections):
    """Given package and map config:(type,value), set selections"""
    text = '\n'.join(' '.join([package, k, t, v]) for
                     k, (t, v) in selections.iteritems())
    sudo('debconf-set-selections <<-HEREDOC\n{}\nHEREDOC'.format(text))