Load options that are represented by annotations
inside of tests i.e @group group1 = --group group1.
546139
protected function initAnnotations()
    {
        $annotatedOptions = ['group'];
        foreach ($this->filtered as $key => $value) {
            if (\in_array($key, $annotatedOptions, true)) {
                $this->annotations[$key] = $value;
            }
        }
    }
590796
public void load()
    {
        transitives.clear();
        for (final String groupIn : mapGroup.getGroups())
        {
            for (final String groupOut : mapGroup.getGroups())
            {
                if (!groupIn.equals(groupOut))
                {
                    findTransitives(groupIn, groupOut);
                }
            }
        }
    }
1130829
def iter_options(grouped_choices, cutoff=None, cutoff_text=None):
    
    class StartOptionGroup(object):
        start_option_group = True
        end_option_group = False

        def __init__(self, label):
            self.label = label

    class EndOptionGroup(object):
        start_option_group = False
        end_option_group = True

    class Option(object):
        start_option_group = False
        end_option_group = False

        def __init__(self, value, display_text, disabled=False):
            self.value = value
            self.display_text = display_text
            self.disabled = disabled

    count = 0

    for key, value in grouped_choices.items():
        if cutoff and count >= cutoff:
            break

        if isinstance(value, dict):
            yield StartOptionGroup(label=key)
            for sub_key, sub_value in value.items():
                if cutoff and count >= cutoff:
                    break
                yield Option(value=sub_key, display_text=sub_value)
                count += 1
            yield EndOptionGroup()
        else:
            yield Option(value=key, display_text=value)
            count += 1

    if cutoff and count >= cutoff and cutoff_text:
        cutoff_text = cutoff_text.format(count=cutoff)
        yield Option(value='n/a', display_text=cutoff_text, disabled=True)
102571
def optgroups(self, name, value, attrs=None):
        """"""
        if not self.is_required and not self.allow_multiple_selected:
            self.choices = list(chain([('', '')], self.choices))
        return super(Select2Mixin, self).optgroups(name, value, attrs=attrs)
440518
private void postSetValidationGroups()
    {
        if (this.validationGroups == null || this.validationGroups.matches(EMPTY_VALIDATION_GROUPS_PATTERN))
        {
            this.validationGroupsArray = DEFAULT_VALIDATION_GROUPS_ARRAY;
        }
        else
        {
            String[] classes = this.validationGroups.split(VALIDATION_GROUPS_DELIMITER);
            List<Class<?>> validationGroupsList = new ArrayList<Class<?>>(classes.length);

            for (String clazz : classes)
            {
                clazz = clazz.trim();
                if (!clazz.isEmpty())
                {
                    Class<?> theClass = null;
                    ClassLoader cl = null;
                    if (System.getSecurityManager() != null) 
                    {
                        try 
                        {
                            cl = AccessController.doPrivileged(new PrivilegedExceptionAction<ClassLoader>()
                                    {
                                        public ClassLoader run() throws PrivilegedActionException
                                        {
                                            return Thread.currentThread().getContextClassLoader();
                                        }
                                    });
                        }
                        catch (PrivilegedActionException pae)
                        {
                            throw new FacesException(pae);
                        }
                    }
                    else
                    {
                        cl = Thread.currentThread().getContextClassLoader();
                    }
                    
                    try
                    {                        
                        // Try WebApp ClassLoader first
                        theClass = Class.forName(clazz,false,cl);
                    }
                    catch (ClassNotFoundException ignore)
                    {
                        try
                        {
                            // fallback: Try ClassLoader for BeanValidator (i.e. the myfaces.jar lib)
                            theClass = Class.forName(clazz,false, BeanValidator.class.getClassLoader());
                        }
                        catch (ClassNotFoundException e)
                        {
                            throw new RuntimeException("Could not load validation group", e);
                        }                        
                    }
                    // the class was found
                    validationGroupsList.add(theClass);
                }
            }
                    
            this.validationGroupsArray = validationGroupsList.toArray(new Class[validationGroupsList.size()]);
        }
    }
1056935
def load_resources(options = {})

      # Determine the name based on the current controller if not specified.
      resource_name = options[:name] || controller_name.pluralize

      # Set an instance variable @name to contain the names for this user.
      #FIXME: Do not hard code Hicube here
      instance_variable_set("@#{resource_name}", "Hicube::#{resource_name.singularize.camelize}".classify.constantize.all)
    end
778477
private void executeGroup(RuleSet ruleSet, Group group, Severity parentSeverity) throws RuleException {
        if (!executedGroups.contains(group)) {
            ruleVisitor.beforeGroup(group, getEffectiveSeverity(group, parentSeverity, parentSeverity));
            for (Map.Entry<String, Severity> conceptEntry : group.getConcepts().entrySet()) {
                applyConcepts(ruleSet, conceptEntry.getKey(), parentSeverity, conceptEntry.getValue());
            }
            for (Map.Entry<String, Severity> groupEntry : group.getGroups().entrySet()) {
                executeGroups(ruleSet, groupEntry.getKey(), parentSeverity, groupEntry.getValue());
            }
            Map<String, Severity> constraints = group.getConstraints();
            for (Map.Entry<String, Severity> constraintEntry : constraints.entrySet()) {
                validateConstraints(ruleSet, constraintEntry.getKey(), parentSeverity, constraintEntry.getValue());
            }
            ruleVisitor.afterGroup(group);
            executedGroups.add(group);
        }
    }
417773
private Map<String, Integer> runSampling(
            final ProctorContext proctorContext,
            final Set<String> targetTestNames,
            final TestType testType,
            final int determinationsToRun
    ) {
        final Set<String> targetTestGroups = getTargetTestGroups(targetTestNames);
        final Map<String, Integer> testGroupToOccurrences = Maps.newTreeMap();
        for (final String testGroup : targetTestGroups) {
            testGroupToOccurrences.put(testGroup, 0);
        }

        for (int i = 0; i < determinationsToRun; ++i) {
            final Identifiers identifiers = TestType.RANDOM.equals(testType)
                    ? new Identifiers(Collections.<TestType, String>emptyMap(), /* randomEnabled */ true)
                    : Identifiers.of(testType, Long.toString(random.nextLong()));
            final AbstractGroups groups = supplier.getRandomGroups(proctorContext, identifiers);
            for (final Entry<String, TestBucket> e : groups.getProctorResult().getBuckets().entrySet()) {
                final String testName = e.getKey();
                if (targetTestNames.contains(testName)) {
                    final int group = e.getValue().getValue();
                    final String testGroup = testName + group;
                    testGroupToOccurrences.put(testGroup, testGroupToOccurrences.get(testGroup) + 1);
                }
            }
        }

        return testGroupToOccurrences;
    }
228663
private void loadTokevalParameters() {
    this.tokevalParser.addArgument("-l", "--language").required(true)
        .choices("ca", "de", "en", "es", "eu", "fr", "it")
        .help("Choose language.\n");
    this.tokevalParser.addArgument("-t", "--testset").required(true)
        .help("The test or reference corpus.\n");
  }
1197005
private void loadMappings() {

		for (int i = 0; i < mappings.length; i++) {

			String[] pair = mappings[i].split(";");
			if (pair.length < 2) {
				try {
					throw new AnnotatorConfigurationException();
				} catch (AnnotatorConfigurationException e) {
					LOGGER.error("[OpenNLP Parser: ]" + e.getMessage());
					e.printStackTrace();
				}
			} else {
				String consTag = pair[0];
				String casTag = pair[1];
				mapTable.put(consTag, casTag);
			}
		}

	}
261210
private void loadTemplateRefGroups( Element parent )
    {
        // Load template refs
        List templateRefGroups = DomUtils.getChildElementsByName( parent, URL_TEMPLATE_REF_GROUP );;
        for ( int i = 0; i < templateRefGroups.size(); i++ )
        {
            Element refGroupElement = ( Element ) templateRefGroups.get( i );
            String refGroupName = getElementText( refGroupElement, NAME );
            if ( refGroupName == null )
            {
                _log.error( "Malformed URL template descriptor in " + _configFilePath
                            + ". The url-template-ref-group name is missing." );
                continue;
            }

            HashMap refGroup = new HashMap();
            List templateRefs = DomUtils.getChildElementsByName( refGroupElement, URL_TEMPLATE_REF );;
            for ( int j = 0; j < templateRefs.size(); j++ )
            {
                Element templateRefElement = ( Element ) templateRefs.get( j );
                String key = getElementText( templateRefElement, KEY );
                if ( key == null )
                {
                    _log.error( "Malformed URL template descriptor in " + _configFilePath
                                + ". The url-template-ref key is missing in url-template-ref-group " + refGroupName );
                    continue;
                }

                String name = getElementText( templateRefElement, TEMPLATE_NAME );
                if ( name != null )
                {
                    refGroup.put( key, name );
                    if ( _log.isDebugEnabled() )
                    {
                        _log.debug( "[" + refGroupName + " URLTemplate] " + key + " = " + name );
                    }
                }
                else
                {
                    _log.error( "Malformed URL template descriptor in " + _configFilePath
                                + ". The url-template-ref template-name is missing in url-template-ref-group " + refGroupName );
                }
            }

            if ( refGroup.size() != 0 )
            {
                _urlTemplates.addTemplateRefGroup( refGroupName, refGroup );
            }
        }
    }
153484
public static <G extends GroupedOptions> G select(String[] params, G... groupings)
    {
        for (String param : params)
        {
            boolean accepted = false;
            for (GroupedOptions grouping : groupings)
                accepted |= grouping.accept(param);
            if (!accepted)
                throw new IllegalArgumentException("Invalid parameter " + param);
        }
        for (G grouping : groupings)
            if (grouping.happy() && grouping.accepted == params.length)
                return grouping;
        return null;
    }
293601
private void doGroupCheck() {
        if (!hasTabs()) return;

        for (String groupName : getGroupNames()) {
            String tabName = getGroupedAttribtes(groupName).get(0).getTabName();
            for (PropertyBinding propBinding : getGroupedAttribtes(groupName)) {
                if (!tabName.equals(propBinding.getTabName())) {
                    throw new RuntimeException("FormItem " + propBinding.getJavaName() + " must be on the same tab with all members of its subgroup.");
                }
            }
        }
    }
1259960
def groups_with_resources(cls, instance):
        
        return instance.groups_dynamic.options(
            sa.orm.eagerload(cls.models_proxy.Group.resources)
        )
742880
private void loadAnnotateParameters() {
    this.annotateParser.addArgument("-m", "--model")
        .required(true)
        .help("It is required to provide a POS tagging model.");
    this.annotateParser.addArgument("-lm", "--lemmatizerModel")
         .required(true)
         .help("It is required to provide a lemmatizer model.");
    this.annotateParser.addArgument("-l", "--language")
        .choices("de", "en", "es", "eu", "fr", "gl", "it", "nl")
        .required(false)
        .help("Choose a language.");

    this.annotateParser.addArgument("--beamSize")
        .required(false)
        .setDefault(DEFAULT_BEAM_SIZE)
        .help("Choose beam size for decoding, it defaults to 3.");
    annotateParser.addArgument("-o", "--outputFormat")
        .required(false)
        .choices("naf", "conll")
        .setDefault(Flags.DEFAULT_OUTPUT_FORMAT)
        .help("Choose output format; it defaults to NAF.\n");
    this.annotateParser.addArgument("-mw", "--multiwords")
        .action(Arguments.storeTrue())
        .help("Use to detect and process multiwords.\n");
    this.annotateParser.addArgument("-d", "--dictag")
        .action(Arguments.storeTrue())
        .help("Post process POS tagger output with a monosemic dictionary.\n");
    this.annotateParser.addArgument("-a","--allMorphology")
        .action(Arguments.storeTrue())
        .help("Print all the POS tags and lemmas before disambiguation.\n");
  }
417889
private void addModelGroupSettings(
        CmsContainerElementData elementBean,
        CmsContainerPageElementPanel elementWidget,
        CmsFieldSet fieldSet) {

        Map<String, String> groupOptions = new LinkedHashMap<String, String>();
        groupOptions.put(GroupOption.disabled.name(), GroupOption.disabled.getLabel());
        groupOptions.put(GroupOption.copy.name(), GroupOption.copy.getLabel());
        groupOptions.put(GroupOption.reuse.name(), GroupOption.reuse.getLabel());
        m_modelGroupSelect = new CmsSelectBox(groupOptions);
        if (elementWidget.isModelGroup()) {
            if (Boolean.valueOf(elementBean.getSettings().get(CmsContainerElement.USE_AS_COPY_MODEL)).booleanValue()) {
                m_modelGroupSelect.selectValue(GroupOption.copy.name());
            } else {
                m_modelGroupSelect.selectValue(GroupOption.reuse.name());
            }
        }
        CmsFormRow selectRow = new CmsFormRow();
        selectRow.getLabel().setText(Messages.get().key(Messages.GUI_USE_AS_MODEL_GROUP_LABEL_0));
        selectRow.getWidgetContainer().add(m_modelGroupSelect);
        fieldSet.add(selectRow);
    }
977700
protected function loadConfigurationGroups()
    {
        collect(config('flame'))->each(function ($item, $key) {
            $this->loadViewsFrom($item['path'], $key);
        });
    }