Return True if real state equal config state otherwise False.
173908
def check_config_state(self):
        """"""
        config = self.config
        self.update_server_map(config)
        for member in config['members']:
            cfg_member_info = self.default_params.copy()
            cfg_member_info.update(member)
            # Remove attributes we can't check.
            for attr in ('priority', 'votes', 'tags', 'buildIndexes'):
                cfg_member_info.pop(attr, None)
            cfg_member_info['host'] = cfg_member_info['host'].lower()

            real_member_info = self.default_params.copy()
            info = self.member_info(member["_id"])
            real_member_info["_id"] = info['_id']
            member_hostname = self._servers.hostname(info['server_id'])
            real_member_info["host"] = member_hostname.lower()
            real_member_info.update(info['rsInfo'])
            logger.debug("real_member_info({member_id}): {info}".format(member_id=member['_id'], info=info))
            for key in cfg_member_info:
                if cfg_member_info[key] != real_member_info.get(key, None):
                    logger.debug("{key}: {value1} ! = {value2}".format(key=key, value1=cfg_member_info[key], value2=real_member_info.get(key, None)))
                    return False
        return True
28758
def check_config(db, level):
    """"""
    if level == 'global':
        configuration = config.read(config.HOMEDIR, '.passpierc')
    elif level == 'local':
        configuration = config.read(os.path.join(db.path))
    elif level == 'current':
        configuration = db.config

    if configuration:
        click.echo(yaml.safe_dump(configuration, default_flow_style=False))
519678
def _is_already_configured(configuration_details):
    """"""
    path = Path(configuration_details.path).expanduser()
    with path.open('r') as shell_config:
        return configuration_details.content in shell_config.read()
223339
def _is_updated(old_conf, new_conf):
    '''
    
    '''
    changed = {}

    # Dirty json hacking to get parameters in the same format
    new_conf = _json_to_unicode(salt.utils.json.loads(
        salt.utils.json.dumps(new_conf, ensure_ascii=False)))
    old_conf = salt.utils.json.loads(salt.utils.json.dumps(old_conf, ensure_ascii=False))

    for key, value in old_conf.items():
        oldval = six.text_type(value).lower()
        if key in new_conf:
            newval = six.text_type(new_conf[key]).lower()
        if oldval == 'null' or oldval == 'none':
            oldval = ''
        if key in new_conf and newval != oldval:
            changed[key] = {'old': oldval, 'new': newval}
    return changed
519558
public static void assertJsonEquals(Object expected, Object actual, Configuration configuration) {
        assertJsonPartEquals(expected, actual, ROOT, configuration);
    }
1088270
function verifyConfiguration (req, sessionKey, cookie) {
  if (!getSecretBag(req, sessionKey, cookie)) {
    return false
  }

  if (cookie && cookie.signed && !req.secret) {
    return false
  }

  return true
}
1140545
def _verify_config(self):
        '''
        
        '''
        if not self.config_dict:
            self._raise_config_exception('No config found')
        # Check for device conifg, if there isn't anything then just log, do not raise an exception
        for dev_os, dev_config in self.config_dict.items():
            if not dev_config:
                log.warning('No config found for %s', dev_os)
                continue
            # Compare the valid opts with the conifg
            self._verify_config_dict(CONFIG.VALID_CONFIG, dev_config, dev_os)
        log.debug('Read the config without error')
1240608
def _check_state(self):
        
        if(self.grid is not None and
           self.configs.configs is not None and
           self.assignments['forward_model'] is not None):
            self.can_model = True

        if(self.grid is not None and
           self.assignments['measurements'] is not None):
            self.can_invert = True
626982
def patch_config(config, data):
    """"""
    is_changed = False
    for name, value in data.items():
        if value is None:
            if config.pop(name, None) is not None:
                is_changed = True
        elif name in config:
            if isinstance(value, dict):
                if isinstance(config[name], dict):
                    if patch_config(config[name], value):
                        is_changed = True
                else:
                    config[name] = value
                    is_changed = True
            elif str(config[name]) != str(value):
                config[name] = value
                is_changed = True
        else:
            config[name] = value
            is_changed = True
    return is_changed
845023
public boolean isTrue(Configuration configuration) {
        for (Clause clause : this.clauses) {
            if (!clause.isTrue(configuration)) return false;
        }

        return true;
    }
950751
def is_default(name=None, index=None):
    

    if not is_configured():
        raise JutException('No configurations available, please run `jut config add`')

    count = 1
    for configuration in _CONFIG.sections():

        if index != None:
            if _CONFIG.has_option(configuration, 'default') and count == index:
                return True

        if name != None:
            if _CONFIG.has_option(configuration, 'default') and configuration == name:
                return True

        count += 1

    return False
1218812
public function isDirty() : bool
    {
        foreach ($this->__state as $prop => $val) {
            if ($this->isModified($prop)) {
                return true;
            }
        }
        return false;
    }
1321370
def compare_config(self):
        """"""
        diff = self.device.cu.diff()

        if diff is None:
            return ''
        else:
            return diff.strip()
1067105
private function isBaseConfigPropertiesSet(): bool
    {
        return isset(
            $this->config[ConfigurationInterface::KEY_APP_ROOT],
            $this->config[ConfigurationInterface::KEY_CONFIG_ROOT],
            $this->config[ConfigurationInterface::KEY_CACHE_ROOT],
            $this->config[ConfigurationInterface::KEY_THEMES_ROOT],
            $this->config[ConfigurationInterface::KEY_CONTENT_ROOT]
        );
    }
523356
function (language) {
  for (var i in config.languages) {
    if (config.languages[i] === language) {return true;}
  }
  //
  return false;
}
680508
def check_config_mode(self, check_string="config", pattern=""):
        """"""
        if not pattern:
            pattern = re.escape(self.base_prompt)
        return super(CiscoWlcSSH, self).check_config_mode(check_string, pattern)
1020603
def _check_config(config):

    '''
    
    '''

    if not _valid_dict(config):
        return True, ''

    _community = config.get('community')
    _community_tmp = {}
    if not _community:
        return False, 'Must specify at least a community.'
    if _valid_str(_community):
        _community_tmp[_community] = _community_defaults()
    elif isinstance(_community, list):
        # if the user specifies the communities as list
        for _comm in _community:
            if _valid_str(_comm):
                # list of values
                _community_tmp[_comm] = _community_defaults()
                # default mode is read-only
            if _valid_dict(_comm):
                # list of dicts
                for _comm_name, _comm_details in six.iteritems(_comm):
                    if _valid_str(_comm_name):
                        _community_tmp[_comm_name] = _clear_community_details(_comm_details)
    elif _valid_dict(_community):
        # directly as dict of communities
        # recommended way...
        for _comm_name, _comm_details in six.iteritems(_community):
            if _valid_str(_comm_name):
                _community_tmp[_comm_name] = _clear_community_details(_comm_details)
    else:
        return False, 'Please specify a community or a list of communities.'

    if not _valid_dict(_community_tmp):
        return False, 'Please specify at least a valid community!'

    config['community'] = _community_tmp

    for key in ['location', 'contact', 'chassis_id']:
        # not mandatory, but should be here only if valid
        _str_elem(config, key)

    return True, ''