Given a list of ValidatorConfig objects, merges them into a single
    ValidatorConfig, giving priority in the order of the configs
    (first has highest priority).
348626
def merge_validator_config(configs):
    
    bind_network = None
    bind_component = None
    bind_consensus = None
    endpoint = None
    peering = None
    seeds = None
    peers = None
    network_public_key = None
    network_private_key = None
    scheduler = None
    permissions = None
    roles = None
    opentsdb_url = None
    opentsdb_db = None
    opentsdb_username = None
    opentsdb_password = None
    minimum_peer_connectivity = None
    maximum_peer_connectivity = None
    state_pruning_block_depth = None
    fork_cache_keep_time = None
    component_thread_pool_workers = None
    network_thread_pool_workers = None
    signature_thread_pool_workers = None

    for config in reversed(configs):
        if config.bind_network is not None:
            bind_network = config.bind_network
        if config.bind_component is not None:
            bind_component = config.bind_component
        if config.bind_consensus is not None:
            bind_consensus = config.bind_consensus
        if config.endpoint is not None:
            endpoint = config.endpoint
        if config.peering is not None:
            peering = config.peering
        if config.seeds is not None:
            seeds = config.seeds
        if config.peers is not None:
            peers = config.peers
        if config.network_public_key is not None:
            network_public_key = config.network_public_key
        if config.network_private_key is not None:
            network_private_key = config.network_private_key
        if config.scheduler is not None:
            scheduler = config.scheduler
        if config.permissions is not None or config.permissions == {}:
            permissions = config.permissions
        if config.roles is not None:
            roles = config.roles
        if config.opentsdb_url is not None:
            opentsdb_url = config.opentsdb_url
        if config.opentsdb_db is not None:
            opentsdb_db = config.opentsdb_db
        if config.opentsdb_username is not None:
            opentsdb_username = config.opentsdb_username
        if config.opentsdb_password is not None:
            opentsdb_password = config.opentsdb_password
        if config.minimum_peer_connectivity is not None:
            minimum_peer_connectivity = config.minimum_peer_connectivity
        if config.maximum_peer_connectivity is not None:
            maximum_peer_connectivity = config.maximum_peer_connectivity
        if config.state_pruning_block_depth is not None:
            state_pruning_block_depth = config.state_pruning_block_depth
        if config.fork_cache_keep_time is not None:
            fork_cache_keep_time = config.fork_cache_keep_time
        if config.component_thread_pool_workers is not None:
            component_thread_pool_workers = \
                config.component_thread_pool_workers
        if config.network_thread_pool_workers is not None:
            network_thread_pool_workers = \
                config.network_thread_pool_workers
        if config.signature_thread_pool_workers is not None:
            signature_thread_pool_workers = \
                config.signature_thread_pool_workers

    return ValidatorConfig(
        bind_network=bind_network,
        bind_component=bind_component,
        bind_consensus=bind_consensus,
        endpoint=endpoint,
        peering=peering,
        seeds=seeds,
        peers=peers,
        network_public_key=network_public_key,
        network_private_key=network_private_key,
        scheduler=scheduler,
        permissions=permissions,
        roles=roles,
        opentsdb_url=opentsdb_url,
        opentsdb_db=opentsdb_db,
        opentsdb_username=opentsdb_username,
        opentsdb_password=opentsdb_password,
        minimum_peer_connectivity=minimum_peer_connectivity,
        maximum_peer_connectivity=maximum_peer_connectivity,
        state_pruning_block_depth=state_pruning_block_depth,
        fork_cache_keep_time=fork_cache_keep_time,
        component_thread_pool_workers=component_thread_pool_workers,
        network_thread_pool_workers=network_thread_pool_workers,
        signature_thread_pool_workers=signature_thread_pool_workers
    )
1330084
def _merge_constraints(constraints, overrides):
    
    for o in overrides:
        i = 0
        while i < len(constraints):
            c = constraints[i]
            if _same(o, c):
                constraints[i].update(o)
                break
            i = i + 1
1014384
private DynamoDBMapperConfig mergeConfig(DynamoDBMapperConfig config) {
        if ( config != this.config )
            config = new DynamoDBMapperConfig(this.config, config);
        return config;
    }
1321023
public static HibernateValidatorConfiguration newConfiguration() {
        return BaseValidator.newConfiguration()
                .constraintValidatorFactory(new MutableValidatorFactory())
                .parameterNameProvider(new JerseyParameterNameProvider())
                .addValueExtractor(NonEmptyStringParamValueExtractor.DESCRIPTOR.getValueExtractor())
                .addValueExtractor(ParamValueExtractor.DESCRIPTOR.getValueExtractor());
    }
758422
function normalizeValidator(validator) {
	        if (validator.validate !== undefined) {
	            return function (c) { return validator.validate(c); };
	        }
	        else {
	            return validator;
	        }
	    }
93004
def validate(self, validators, resp_obj):
        
        self.validation_results = []
        if not validators:
            return

        logger.log_debug("start to validate.")

        validate_pass = True
        failures = []

        for validator in validators:
            # validator should be LazyFunction object
            if not isinstance(validator, parser.LazyFunction):
                raise exceptions.ValidationFailure(
                    "validator should be parsed first: {}".format(validators))

            # evaluate validator args with context variable mapping.
            validator_args = validator.get_args()
            check_item, expect_item = validator_args
            check_value = self.__eval_validator_check(
                check_item,
                resp_obj
            )
            expect_value = self.__eval_validator_expect(expect_item)
            validator.update_args([check_value, expect_value])

            comparator = validator.func_name
            validator_dict = {
                "comparator": comparator,
                "check": check_item,
                "check_value": check_value,
                "expect": expect_item,
                "expect_value": expect_value
            }
            validate_msg = "\nvalidate: {} {} {}({})".format(
                check_item,
                comparator,
                expect_value,
                type(expect_value).__name__
            )

            try:
                validator.to_value(self.test_variables_mapping)
                validator_dict["check_result"] = "pass"
                validate_msg += "\t==> pass"
                logger.log_debug(validate_msg)
            except (AssertionError, TypeError):
                validate_pass = False
                validator_dict["check_result"] = "fail"
                validate_msg += "\t==> fail"
                validate_msg += "\n{}({}) {} {}({})".format(
                    check_value,
                    type(check_value).__name__,
                    comparator,
                    expect_value,
                    type(expect_value).__name__
                )
                logger.log_error(validate_msg)
                failures.append(validate_msg)

            self.validation_results.append(validator_dict)

            # restore validator args, in case of running multiple times
            validator.update_args(validator_args)

        if not validate_pass:
            failures_string = "\n".join([failure for failure in failures])
            raise exceptions.ValidationFailure(failures_string)
1272648
def _merge_configuration(self, parent_config, child_options):
        
        # Copy the parent error codes so we won't override them
        error_codes = copy.deepcopy(parent_config.checked_codes)
        if self._has_exclusive_option(child_options):
            error_codes = self._get_exclusive_error_codes(child_options)

        self._set_add_options(error_codes, child_options)

        kwargs = dict(checked_codes=error_codes)
        for key in ('match', 'match_dir', 'ignore_decorators'):
            kwargs[key] = \
                getattr(child_options, key) or getattr(parent_config, key)
        return CheckConfiguration(**kwargs)
653254
def merge_color_configs(first, second):
    
    # We have to get the desired values first and simultaneously, as nametuple
    # is immutable.
    pound = get_priority(first.pound, second.pound, None)
    heading = get_priority(first.heading, second.heading, None)
    code = get_priority(first.code, second.code, None)
    backticks = get_priority(first.backticks, second.backticks, None)
    prompt = get_priority(first.prompt, second.prompt, None)
    pound_reset = get_priority(
        first.pound_reset,
        second.pound_reset,
        None
    )
    heading_reset = get_priority(
        first.heading_reset,
        second.heading_reset,
        None
    )
    code_reset = get_priority(
        first.code_reset,
        second.code_reset,
        None
    )
    backticks_reset = get_priority(
        first.backticks_reset,
        second.backticks_reset,
        None
    )
    prompt_reset = get_priority(
        first.prompt_reset,
        second.prompt_reset,
        None
    )

    result = ColorConfig(
        pound=pound,
        heading=heading,
        code=code,
        backticks=backticks,
        prompt=prompt,
        pound_reset=pound_reset,
        heading_reset=heading_reset,
        code_reset=code_reset,
        backticks_reset=backticks_reset,
        prompt_reset=prompt_reset
    )

    return result
426659
private void mergeOneOf() {
        if (SchemaCompositeMatchers.hasOneOf().matches(schema)) {
            SchemaList list = schema.getOneOf();
            Schema choice = list.get(rnd.nextInt(list.size()));
            schema.getJson().remove("oneOf");
            schema.merge(choice);
        }
    }
1349522
function (config) {
                if (typeof config !== 'object') {
                    throw new Error('You must provide a valid configuration object to the config setter.');
                }
                // combine config with default
                var mergedConfig = Object.assign({}, config);
                // add config to map
                this._config = new Map(Object.entries(mergedConfig));
            }
601223
public List<FacesConfigDefaultValidatorsType<FacesConfigApplicationType<T>>> getAllDefaultValidators()
   {
      List<FacesConfigDefaultValidatorsType<FacesConfigApplicationType<T>>> list = new ArrayList<FacesConfigDefaultValidatorsType<FacesConfigApplicationType<T>>>();
      List<Node> nodeList = childNode.get("default-validators");
      for(Node node: nodeList)
      {
         FacesConfigDefaultValidatorsType<FacesConfigApplicationType<T>>  type = new FacesConfigDefaultValidatorsTypeImpl<FacesConfigApplicationType<T>>(this, "default-validators", childNode, node);
         list.add(type);
      }
      return list;
   }
496734
@SuppressWarnings("unchecked")
    private List<RaConfigProperty> mergeConfigProperties(List<RaConfigProperty> rxConfigProperties, List<RaConfigProperty> annotatedConfigProperties) {
        final boolean trace = TraceComponent.isAnyTracingEnabled();

        LinkedList<RaConfigProperty> configProperties = new LinkedList<RaConfigProperty>();
        List<RaConfigProperty> annoConfigProperties = null;
        if (annotatedConfigProperties != null)
            annoConfigProperties = (List<RaConfigProperty>) ((LinkedList<RaConfigProperty>) annotatedConfigProperties).clone();
        else
            annoConfigProperties = new LinkedList<RaConfigProperty>();

        if (trace && tc.isDebugEnabled())
            Tr.debug(this, tc,
                     "rxConfigProperties size: " + rxConfigProperties.size());

        for (RaConfigProperty rxConfigProp : rxConfigProperties) {
            RaConfigProperty annoConfigProp = null;

            if (annoConfigProperties.isEmpty()) {
                return (List<RaConfigProperty>) ((LinkedList<RaConfigProperty>) rxConfigProperties).clone();
            } else {
                for (RaConfigProperty configProp : annoConfigProperties)
                    if (isEqual(rxConfigProp.getName(), configProp.getName())) {
                        annoConfigProp = configProp;
                        break;
                    }

                if (annoConfigProp != null) {
                    if (trace && tc.isDebugEnabled())
                        Tr.debug(this, tc, "merging " + rxConfigProp + ", " + annoConfigProp);

                    // remove the config property from the list so we know at the end if there
                    // are any additional annotated-only config properties that we need to copy
                    // into the master
                    annoConfigProperties.remove(annoConfigProp);

                    // merge the two config properties
                    if (rxConfigProp.getConfidential() == null)
                        rxConfigProp.setConfidential(annoConfigProp.getConfidential());

                    if (rxConfigProp.getDescription() == null || rxConfigProp.getDescription().isEmpty())
                        rxConfigProp.setDescription(annoConfigProp.getDescription());

                    if (rxConfigProp.getIgnore() == null)
                        rxConfigProp.setIgnore(annoConfigProp.getIgnore());

                    if (rxConfigProp.getSupportsDynamicUpdates() == null)
                        rxConfigProp.setSupportsDynamicUpdates(annoConfigProp.getSupportsDynamicUpdates());

                    if (rxConfigProp.getType() == null || rxConfigProp.getType().equals(""))
                        rxConfigProp.setType(annoConfigProp.getType());

                    if (rxConfigProp.getDefault() == null || rxConfigProp.getDefault().equals(""))
                        rxConfigProp.setDefault(annoConfigProp.getDefault());

                    configProperties.add(rxConfigProp);
                } else {
                    configProperties.add(rxConfigProp);
                }
            }
        }

        if (!annoConfigProperties.isEmpty()) {
            // there are annotated config properties that do not exist already in the ra.xml,
            // thus add them to the master
            for (RaConfigProperty configProp : annoConfigProperties)
                configProperties.add(configProp);
        }

        return configProperties;
    }
31540
public function mergeConfigs(array $lowPriorityConfig, array $highPriorityConfig)
    {
        foreach ($highPriorityConfig as $key => $value) {
            if ($highPriorityConfig[$key] !== '') {
                $lowPriorityConfig[$key] = $highPriorityConfig[$key];
            }
        }
        return $lowPriorityConfig;
    }
201214
def merge_config(self, user_config):
        '''
        
        '''

        # provisioanlly update the default configurations with the user preferences
        temp_data_config = copy.deepcopy(self.data_config).update(user_config)
        temp_model_config = copy.deepcopy(self.model_config).update(user_config)
        temp_conversation_config = copy.deepcopy(self.conversation_config).update(user_config)

        # if the new configurations validate, apply them
        if validate_data_config(temp_data_config):
            self.data_config = temp_data_config
        if validate_model_config(temp_model_config):
            self.model_config = temp_model_config
        if validate_conversation_config(temp_conversation_config):
            self.conversation_config = temp_conversation_config
30373
private Validator createDefaultValidator() {
        final ValidatorFactory validatorFactory = Validation.buildDefaultValidatorFactory();
        final Validator validator = validatorFactory.usingContext()
                .getValidator();
        
        return validator;
    }
269692
public static void initializeComparators(Configuration conf, TupleMRConfig groupConfig) {
    TupleMRConfigBuilder.initializeComparators(conf, groupConfig.getCommonCriteria());
    for (Criteria criteria : groupConfig.getSpecificOrderBys()) {
      if (criteria != null) {
        TupleMRConfigBuilder.initializeComparators(conf, criteria);
      }
    }
  }
1066696
public CombinableConfig combine(Config... fallbackConfigs) {
        CombinableConfig newConfig = this;
        for (Config fallback : fallbackConfigs) {
            newConfig = new ConfigWithFallback(newConfig, fallback);
        }
        return newConfig;
    }