'Sets (enables) a given list of modes.
:param list modes: modes to set, where each mode is a constant
from :mod:`pyte.modes`.'

def set_mode(self, *modes, **kwargs):

    if kwargs.get(u'private'):
        modes = [(mode << 5) for mode in modes]
    self.mode.update(modes)
    if (mo.DECCOLM in modes):
        self.resize(columns=132)
        self.erase_in_display(2)
        self.cursor_position()
    if (mo.DECOM in modes):
        self.cursor_position()
    if (mo.DECSCNM in modes):
        self.buffer[:] = ([char._replace(reverse=True) for char in line] for line in self.buffer)
        self.select_graphic_rendition(g._SGR[u'+reverse'])
    if (mo.DECTCEM in modes):
        self.cursor.hidden = False
