Validate bookstore configuration settings.
    
    Parameters
    ----------
    settings: bookstore.bookstore_config.BookstoreSettings
        The instantiated `Settings` object to be validated.
429478
def validate_bookstore(settings: BookstoreSettings):
    
    general_settings = [settings.s3_bucket != "", settings.s3_endpoint_url != ""]
    archive_settings = [settings.workspace_prefix != ""]
    published_settings = [settings.published_prefix != ""]

    validation_checks = {
        "bookstore_valid": all(general_settings),
        "archive_valid": all(archive_settings),
        "publish_valid": all(published_settings),
    }
    return validation_checks
322324
def _validate_order_book(self, book):
        
        if book not in self.order_books:
            raise InvalidOrderBookError(
                'Invalid order book \'{}\'. Choose from {}.'
                .format(book, tuple(self.order_books))
            )
85968
def validate_configuration(config):
    # type: (Config) -> None
    
    routes = config.chalice_app.routes
    validate_routes(routes)
    validate_route_content_types(routes, config.chalice_app.api.binary_types)
    _validate_manage_iam_role(config)
    validate_python_version(config)
    validate_unique_function_names(config)
    validate_feature_flags(config.chalice_app)
1273791
private void validateSettings(
        CmsEntity entity,
        CmsValidationResult validationResult,
        Map<String, CmsXmlContentProperty> settingsConfig) {

        Map<String, Map<String[], String>> errors = validationResult.getErrors();
        Map<String[], String> entityErrors = errors.get(entity.getId());
        if (entityErrors == null) {
            entityErrors = new HashMap<String[], String>();
        }
        Map<String, Map<String[], String>> warnings = validationResult.getWarnings();
        Map<String[], String> entityWarnings = warnings.get(entity.getId());
        if (entityWarnings == null) {
            entityWarnings = new HashMap<String[], String>();
        }

        for (CmsEntityAttribute attribute : entity.getAttributes()) {
            if (isSettingsAttribute(attribute.getAttributeName())) {
                if (attribute.isSimpleValue()) {
                    String settingsKey = attribute.getAttributeName().substring(
                        SETTINGS_ATTRIBUTE_NAME_PREFIX.length() + 1);
                    CmsXmlContentProperty prop = settingsConfig.get(settingsKey);
                    if (prop != null) {
                        String regex = prop.getRuleRegex();
                        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(regex)) {
                            if (!attribute.getSimpleValue().matches(regex)) {
                                String[] path = new String[] {attribute.getAttributeName()};

                                if (SETTINGS_RULE_TYPE_ERROR.equals(prop.getRuleType())) {
                                    entityErrors.put(path, prop.getError());
                                } else {
                                    entityWarnings.put(path, prop.getError());
                                }
                            }
                        }
                    }
                } else {
                    CmsEntity nested = attribute.getComplexValue();
                    for (CmsEntityAttribute nestedAttribute : nested.getAttributes()) {
                        String settingsKey = nestedAttribute.getAttributeName().substring(
                            SETTINGS_ATTRIBUTE_NAME_PREFIX.length() + 1);
                        CmsXmlContentProperty prop = settingsConfig.get(settingsKey);
                        if (prop != null) {
                            String regex = prop.getRuleRegex();
                            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(regex)) {
                                if (!nestedAttribute.getSimpleValue().matches(regex)) {
                                    String[] path = new String[] {
                                        attribute.getAttributeName(),
                                        nestedAttribute.getAttributeName()};
                                    if (SETTINGS_RULE_TYPE_ERROR.equals(prop.getRuleType())) {
                                        entityErrors.put(path, prop.getError());
                                    } else {
                                        entityWarnings.put(path, prop.getError());
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (!entityErrors.isEmpty()) {
            errors.put(entity.getId(), entityErrors);
        }
        if (!entityWarnings.isEmpty()) {
            warnings.put(entity.getId(), entityWarnings);
        }

    }
1031882
def config(settings):
    
    parameter_settings = Parameter()
    for k, v in settings.items():
        if isinstance(v, OrderedDict):
            k_settings = Parameter()
            for ki, vi in v.items():
                k_settings[ki] = vi
        else:
            k_settings = v
        parameter_settings[k] = k_settings

    return parameter_settings
431177
def set_config(self, key, value):
        

        keyname = "config:" + key

        self.kvstore.set(keyname, value)
1365795
def validate_configuration(self):
        
        super().validate_configuration()

        if self.use_registry_name is None:
            raise ArcaMisconfigured("Use registry name setting is required for VagrantBackend")

        if not re.match(r"^[a-z]+/[a-zA-Z0-9\-_]+$", self.box):
            raise ArcaMisconfigured("Provided Vagrant box is not valid")

        if not re.match(r"^[a-z_]+$", self.provider):
            raise ArcaMisconfigured("Provided Vagrant provider is not valid")

        if self.registry_pull_only:
            raise ArcaMisconfigured("Push must be enabled for VagrantBackend")
280008
def settingsAsFacts(self, settings):
        
        pattern = re.compile('set\(([a-zA-Z0-9_]+),(\[a-zA-Z0-9_]+)\)')
        pairs = pattern.findall(settings)
        for name, val in pairs:
            self.set(name, val)
709314
def check_config(self, config):
        
        validation = ""
        required = ["name", "currency", "IBAN", "BIC"]

        for config_item in required:
            if config_item not in config:
                validation += config_item.upper() + "_MISSING "

        if not validation:
            return True
        else:
            raise Exception("Config file did not validate. " + validation)
462000
def check(cls):
        
        if cls == AppSettings:
            return None

        exceptions = []
        for setting in cls.settings.values():
            try:
                setting.check()
            # pylama:ignore=W0703
            except Exception as e:
                exceptions.append(str(e))
        if exceptions:
            raise ImproperlyConfigured("\n".join(exceptions))
591004
def validate(self, config):
        
        if not isinstance(config, ConfigObject):
            raise Exception("Config object expected")

        if config["output"]["componants"] not in ("local", "remote", "embedded", "without"):
            raise ValueError("Unknown componant \"%s\"." % config["output"]["componants"])

        if config["output"]["layout"] not in ("default", "content-only"):
            raise ValueError("Unknown layout \"%s\"." % config["output"]["layout"])

        if config["input"]["locations"] is not None:
            unknown_locations = [x for x in config["input"]["locations"] if not os.path.exists(x)]
            if len(unknown_locations) > 0:
                raise ValueError(
                    "Location%s \"%s\" does not exists"
                    % ("s" if len(unknown_locations) > 1 else "", ("\" and \"").join(unknown_locations))
                )

            config["input"]["locations"] = [os.path.realpath(x) for x in config["input"]["locations"]]

        if config["input"]["arguments"] is not None:
            if not isinstance(config["input"]["arguments"], dict):
                raise ValueError(
                    "Sources arguments \"%s\" are not a dict" % config["input"]["arguments"]
                )
222126
def _validate_config(config):
    
    required_keys = [KEY_ADDRESS, KEY_MODEL, KEY_PORT, KEY_PATHS]
    for key in required_keys:
        if key not in config:
            raise Error("Required key %s missing from config %s",
                        (key, config))
200882
def configure_settings(settings, environment_settings=True):
    '''
    
    '''
    changes = 1
    iterations = 0

    while changes:
        changes = 0
        app_names = ['django_autoconfig'] + list(settings['INSTALLED_APPS'])
        if environment_settings:
            app_names.append('django_autoconfig.environment_settings')
        for app_name in app_names:
            import django_autoconfig.contrib
            if autoconfig_module_exists(app_name):
                module = importlib.import_module("%s.autoconfig" % (app_name,))
            elif app_name in django_autoconfig.contrib.CONTRIB_CONFIGS:
                module = django_autoconfig.contrib.CONTRIB_CONFIGS[app_name]
            else:
                continue
            changes += merge_dictionaries(
                settings,
                getattr(module, 'SETTINGS', {}),
                template_special_case=True,
            )
            changes += merge_dictionaries(
                settings,
                getattr(module, 'DEFAULT_SETTINGS', {}),
                only_defaults=True,
            )
            for relationship in getattr(module, 'RELATIONSHIPS', []):
                changes += relationship.apply_changes(settings)

        if iterations >= MAX_ITERATIONS:
            raise ImproperlyConfigured(
                'Autoconfiguration could not reach a consistent state'
            )
        iterations += 1
    LOGGER.debug("Autoconfiguration took %d iterations.", iterations)
205311
def validate(config):
    '''
    
    '''
    valid = True
    messages = []

    if not isinstance(config, list):
        valid = False
        messages.append('[-] Configuration for %s beacon must be a list', config)
    else:
        _config = {}
        list(map(_config.update, config))

    try:
        sites = _config.get('sites', {})
    except AttributeError:
        valid = False
        messages.append('[-] Sites for %s beacon must be a dict', __virtualname__)

    if not sites:
        valid = False
        messages.append('[-] Configuration does not contain sites')

    for site, settings in sites.items():
        if required_site_attributes.isdisjoint(set(settings.keys())):
            valid = False
            messages.append('[-] Sites for {} beacon requires {}'.format(__virtualname__,
                                                                         required_site_attributes))
        log.debug('[+] site: %s', site)
        log.debug('[+] settings: %s', settings)

        for optional_attrs in itertools.chain(settings.get(attr, []) for attr in optional_site_attributes):
            for item in optional_attrs:
                cmp = item.get('comp')
                if cmp and cmp not in comparisons:
                    valid = False
                    messages.append('[-] Invalid comparison operator %s', cmp)

    messages.append('[+] Valid beacon configuration')
    return valid, messages
566879
def load_config(self, settings=None):
        
        self._load_defaults()
        if settings:
            self.update(settings)
        else:
            config_paths = _get_config_files()
            for p in config_paths:
                conf = _process_config_file([p])
                self.update(conf)
        self._loaded = True
        self._validate()
1084800
def _validate_config(strict=False):
    """"""
    for index in settings.get_index_names():
        _validate_mapping(index, strict=strict)
        for model in settings.get_index_models(index):
            _validate_model(model)
    if settings.get_setting("update_strategy", "full") not in ["full", "partial"]:
        raise ImproperlyConfigured(
            "Invalid SEARCH_SETTINGS: 'update_strategy' value must be 'full' or 'partial'."
        )
846906
def validate(cls, full_config: typing.Dict[str, typing.Any]) -> typing.Dict[str, typing.Any]:
        
        if cls.key is not None:
            if cls.key in full_config:
                return {cls.key: full_config[cls.key]}
            elif cls.required:
                return {cls.key: cls.default}