Maps aliased discovery strategy configs into discovery strategy configs.
321460
public static List<DiscoveryStrategyConfig> map(List<AliasedDiscoveryConfig<?>> aliasedDiscoveryConfigs) {
        List<DiscoveryStrategyConfig> result = new ArrayList<DiscoveryStrategyConfig>();
        for (AliasedDiscoveryConfig config : aliasedDiscoveryConfigs) {
            if (config.isEnabled()) {
                result.add(createDiscoveryStrategyConfig(config));
            }
        }
        return result;
    }
339601
def find_matching_endpoints(self, discovery_ns):
        
        def match_func(operation, ns, rule):
            return operation in self.matching_operations

        return list(iter_endpoints(self.graph, match_func))
5009
function HostMapping(settings) {
        settings.init("hostConfig", {});
        settings.init("hostMapping", {});
        settings.init("xdmConfig", {});
        this.settings = settings;
      }
77192
def _discover_masters(self):
        '''
        
        '''
        if self.opts['master'] == DEFAULT_MINION_OPTS['master'] and self.opts['discovery'] is not False:
            master_discovery_client = salt.utils.ssdp.SSDPDiscoveryClient()
            masters = {}
            for att in range(self.opts['discovery'].get('attempts', 3)):
                try:
                    att += 1
                    log.info('Attempting %s time(s) to discover masters', att)
                    masters.update(master_discovery_client.discover())
                    if not masters:
                        time.sleep(self.opts['discovery'].get('pause', 5))
                    else:
                        break
                except Exception as err:
                    log.error('SSDP discovery failure: %s', err)
                    break

            if masters:
                policy = self.opts.get('discovery', {}).get('match', 'any')
                if policy not in ['any', 'all']:
                    log.error('SSDP configuration matcher failure: unknown value "%s". '
                              'Should be "any" or "all"', policy)
                    return
                mapping = self.opts['discovery'].get('mapping', {})
                discovered = []
                for addr, mappings in masters.items():
                    for proto_data in mappings:
                        cnt = len([key for key, value in mapping.items()
                                   if proto_data.get('mapping', {}).get(key) == value])
                        if policy == 'any' and bool(cnt) or cnt == len(mapping):
                            if self.opts['discovery'].get('multimaster'):
                                discovered.append(proto_data['master'])
                            else:
                                self.opts['master'] = proto_data['master']
                                return
                self.opts['master'] = discovered
250451
def _build_default_options(self):
        "
        return [
            OptionDefault('model', None, inherit=True),
            OptionDefault('abstract', False, inherit=False),
            OptionDefault('strategy', enums.CREATE_STRATEGY, inherit=True),
            OptionDefault('inline_args', (), inherit=True),
            OptionDefault('exclude', (), inherit=True),
            OptionDefault('rename', {}, inherit=True),
        ]
13303
protected function prepareStrategies()
    {
        $associations = $this->metadata->getAssociationNames();

        foreach ($associations as $association) {
            if ($this->metadata->isCollectionValuedAssociation($association)) {
                // Add a strategy if the association has none set by user
                if (! $this->hasStrategy($association)) {
                    if ($this->byValue) {
                        $strategyClassName = $this->getDefaultByValueStrategy();
                    } else {
                        $strategyClassName = $this->getDefaultByReferenceStrategy();
                    }

                    $this->addStrategy($association, new $strategyClassName());
                }

                $strategy = $this->getStrategy($association);

                if (! $strategy instanceof Strategy\AbstractCollectionStrategy) {
                    throw new InvalidArgumentException(
                        sprintf(
                            'Strategies used for collections valued associations must inherit from '
                            . 'Strategy\AbstractCollectionStrategy, %s given',
                            get_class($strategy)
                        )
                    );
                }

                $strategy->setCollectionName($association)
                         ->setClassMetadata($this->metadata);
            }
        }
    }
517595
def get_id2config_mapping(self):
		
		new_dict = {}
		for k, v in self.data.items():
			new_dict[k] = {}
			new_dict[k]['config'] = copy.deepcopy(v.config)
			try:
				new_dict[k]['config_info'] = copy.deepcopy(v.config_info)
			except:
				pass
		return(new_dict)
237701
def configure_discover(self, ns, definition):
        
        page_schema = OffsetLimitPageSchema()

        @self.add_route("/", Operation.Discover, ns)
        def discover():
            # accept pagination limit from request
            page = OffsetLimitPage.from_query_string(page_schema)
            page.offset = 0

            response_data = dict(
                _links=Links({
                    "self": Link.for_(Operation.Discover, ns, qs=page.to_items()),
                    "search": [
                        link for link in iter_links(self.find_matching_endpoints(ns), page)
                    ],
                }).to_dict()
            )
            return make_response(response_data)
503079
def configure_relation
      case strategy
      when :ref_many      
        has_many_for subject_class, :role, :through => join_key 
        
        belongs_to_for join_model, subject_class
        belongs_to_for join_model, object_model

        has_many_for role, subject_class, :through => join_key 
        
      when :embed_many
        embeds_many subject_class, object_model
      end
    end
1284762
private void configureAnalysisFeatures() {
        for (AnalysisFeatureSetting setting : analysisOptions.analysisFeatureSettingList) {
            setting.configure(AnalysisContext.currentAnalysisContext());
        }
        AnalysisContext.currentAnalysisContext().setBoolProperty(AnalysisFeatures.MERGE_SIMILAR_WARNINGS,
                analysisOptions.mergeSimilarWarnings);
    }
1194314
private <K, V> CacheConfiguration<K, V> adjustConfigurationWithCacheManagerDefaults(String alias, CacheConfiguration<K, V> config) {
    ClassLoader cacheClassLoader = config.getClassLoader();

    List<ServiceConfiguration<?>> configurationList = new ArrayList<>();
    configurationList.addAll(config.getServiceConfigurations());

    CacheLoaderWriterConfiguration loaderWriterConfiguration = findSingletonAmongst(CacheLoaderWriterConfiguration.class, config.getServiceConfigurations());
    if (loaderWriterConfiguration == null) {
      CacheLoaderWriterProvider loaderWriterProvider = serviceLocator.getService(CacheLoaderWriterProvider.class);
      ServiceConfiguration<CacheLoaderWriterProvider> preConfiguredCacheLoaderWriterConfig = loaderWriterProvider.getPreConfiguredCacheLoaderWriterConfig(alias);
      if (preConfiguredCacheLoaderWriterConfig != null) {
        configurationList.add(preConfiguredCacheLoaderWriterConfig);
      }
      if (loaderWriterProvider.isLoaderJsrProvided(alias)) {
        configurationList.add(new CacheLoaderWriterConfiguration() {
        });
      }
    }

    ServiceConfiguration<?>[] serviceConfigurations = new ServiceConfiguration<?>[configurationList.size()];
    configurationList.toArray(serviceConfigurations);

    if (cacheClassLoader == null) {
      cacheClassLoader = cacheManagerClassLoader;
    }
    if (cacheClassLoader != config.getClassLoader() ) {
      config = new BaseCacheConfiguration<>(config.getKeyType(), config.getValueType(),
        config.getEvictionAdvisor(), cacheClassLoader, config.getExpiryPolicy(),
        config.getResourcePools(), serviceConfigurations);
    } else {
      config = new BaseCacheConfiguration<>(config.getKeyType(), config.getValueType(),
              config.getEvictionAdvisor(), config.getClassLoader(), config.getExpiryPolicy(),
              config.getResourcePools(), serviceConfigurations);
    }
    return config;
  }
158359
def _create_mappings(self, spec):
        
        ret = dict(zip(set(spec.fields), set(spec.fields)))
        ret.update(dict([(n, s.alias) for n, s in spec.fields.items() if s.alias]))
        return ret
678597
public static List<AliasedDiscoveryConfig<?>> aliasedDiscoveryConfigsFrom(WanPublisherConfig config) {
        return asList(config.getAwsConfig(), config.getGcpConfig(), config.getAzureConfig(), config.getKubernetesConfig(),
                config.getEurekaConfig());
    }
19666
def run(self):
        
        logger.info(
            "The {} strategy will be applied on each duplicate set.".format(
                self.conf.strategy))

        self.stats['set_total'] = len(self.mails)

        for hash_key, mail_path_set in self.mails.items():
            # Print visual clue to separate duplicate sets.
            logger.info('---')

            duplicates = DuplicateSet(hash_key, mail_path_set, self.conf)

            # Perfom the deduplication.
            duplicates.dedupe()

            # Merge stats resulting of actions on duplicate sets.
            self.stats += duplicates.stats
593366
def skos_hierarchical_mappings(rdf, narrower=True):
    
    for s, o in rdf.subject_objects(SKOS.broadMatch):
        rdf.add((s, SKOS.broader, o))
        if narrower:
            rdf.add((o, SKOS.narrowMatch, s))
            rdf.add((o, SKOS.narrower, s))

    for s, o in rdf.subject_objects(SKOS.narrowMatch):
        rdf.add((o, SKOS.broadMatch, s))
        rdf.add((o, SKOS.broader, s))
        if narrower:
            rdf.add((s, SKOS.narrower, o))
        else:
            rdf.remove((s, SKOS.narrowMatch, o))
645371
function build_ext_define_patterns(namespaces) {
  var mappedNamespaced = _.map(namespaces, function(ns) {
    [ns + ".define", ns + ".ClassManager.create"]
  });
  return _.flatten(mappedNamespaced);
}
1311250
public static AliasedDiscoveryConfig newAliasedDiscoveryConfig(String name) {
        if ("aws".equals(name)) {
            return new ClientAwsConfig();
        } else {
            return AliasedDiscoveryConfigUtils.newConfigFor(name);
        }
    }