'Checks if the device is in configuration mode or not.'

def check_config_mode(self, check_string=u'', pattern=u''):

    log.debug(u'pattern:    {0}'.format(pattern))
    self.write_channel(u'\n')
    output = self.read_until_pattern(pattern=pattern)
    log.debug(u'check_config_mode:    {0}'.format(repr(output)))
    return (check_string in output)
