'Attempt to become root.'

def enable(self, cmd=u'sudo    su', pattern=u'ssword', re_flags=re.IGNORECASE):

    delay_factor = self.select_delay_factor(delay_factor=0)
    output = u''
    if (not self.check_enable_mode()):
        self.write_channel(self.normalize_cmd(cmd))
        time.sleep((0.3 * delay_factor))
        try:
            output += self.read_channel()
            if re.search(pattern, output, flags=re_flags):
                self.write_channel(self.normalize_cmd(self.secret))
            self.set_base_prompt()
        except socket.timeout:
            raise NetMikoTimeoutException(u'Timed-out    reading    channel,    data    not    available.')
        if (not self.check_enable_mode()):
            raise ValueError(u'Failed    to    enter    enable    mode.')
    return output
