Choose multiple options from a list.
962366
def DEFINE_multichoice(self, name, default, choices, help, constant=False):
    """"""
    self.AddOption(
        type_info.MultiChoice(
            name=name, default=default, choices=choices, description=help),
        constant=constant)
323591
def choices(self):
        """"""

        if self._choices == None:
            self._choices = [ExperimentChoice(self, choice_name) for choice_name in self.choice_names]

        return self._choices
406483
def _select_features(example, feature_list=None):
  """"""
  feature_list = feature_list or ["inputs", "targets"]
  return {f: example[f] for f in feature_list}
1239193
def optgroups(self, name, value, attrs=None):
        """"""
        groups = []
        has_selected = False
        if attrs is None:
            attrs = {}

        for index, (option_value, option_label, sort_fields) in enumerate(
                chain(self.choices)):

            # Set tree attributes
            attrs['data-tree-id'] = sort_fields[0]
            attrs['data-left-value'] = sort_fields[1]

            subgroup = []
            subindex = None
            choices = [(option_value, option_label)]
            groups.append((None, subgroup, index))

            for subvalue, sublabel in choices:
                selected = (
                    force_text(subvalue) in value and
                    (has_selected is False or self.allow_multiple_selected)
                )
                if selected is True and has_selected is False:
                    has_selected = True
                subgroup.append(self.create_option(
                    name, subvalue, sublabel, selected, index,
                    subindex=subindex, attrs=attrs,
                ))

        return groups
281836
def choice(choices):
    """"""
    def decorator(function):
        """Decorate a function with args."""
        @functools.wraps(function)
        def wrapper(*args, **kwargs):
            """Wrap the function."""
            series = function(*args, **kwargs)
            return series.isin(set(choices))

        return wrapper

    return decorator
210618
def options(self, section):
        """"""
        try:
            opts = self._sections[section].copy()
        except KeyError:
            raise from_none(NoSectionError(section))
        opts.update(self._defaults)
        return list(opts.keys())
697492
def selectisinstance(table, field, value, complement=False):
    """"""

    return selectop(table, field, value, isinstance, complement=complement)
485626
def randomize(length=6, choices=None):
    """"""
    if type(choices) == str:
        choices = list(choices)
    choices = choices or ascii_lowercase
    return "".join(choice(choices) for _ in range(length))
1021141
def selected(self, ids):
        
        result = copy(self.choices)
        result = filter(lambda x: x[0] in ids, result)
        # result = ((item, item) for item in result)
        return list(result)
1075815
def _setChoice(self,s,strict=0):
        """"""
        clist = _getChoice(s,strict)
        self.choice = list(map(self._coerceValue, clist))
        self._setChoiceDict()
1356124
def as_list_with_options(self):
        
        it = ROOT.TIter(self)
        elem = it.Next()
        result = []
        while elem:
            if it.GetOption():
                result.append(TListItemWithOption(elem, it.GetOption()))
            else:
                result.append(elem)
            elem = it.Next()
        return result
323701
def collection_choices():
    """"""
    from invenio_collections.models import Collection
    return [(0, _('-None-'))] + [
        (c.id, c.name) for c in Collection.query.all()
    ]
1130974
def multi_option(*param_decls, **attrs):
    
    attrhelp = attrs.get('help', None)
    if attrhelp is not None:
        newhelp = attrhelp + " (multiple occurrence permitted)"
        attrs['help'] = newhelp
    attrs['multiple'] = True
    return click.option(*param_decls, **attrs)
612126
def get_choice(value):
    """"""
    if value is None:
        return 'null'
    for attr in ['__name__', 'name']:
        if hasattr(value, attr):
            return getattr(value, attr)
    return str(value)
129825
def choice(name, choices = [], options = {})
      field name, ChoiceField.new(choices, options)
    end
838083
def choose(items, title_text, question_text):
    
    print(title_text)

    for i, item in enumerate(items, start=1):
        print('%d) %s' % (i, item))
    print('%d) Abort' % (i + 1))

    selected = input(question_text)
    try:
        index = int(selected)
    except ValueError:
        index = -1
    if not (index - 1) in range(len(items)):
        print('Aborting.')
        return None

    return items[index - 1]
600290
def getoptlist(self, p):
        """"""
        optlist = []
        for k, v in self.pairs:
            if k == p:
                optlist.append(v)
        return optlist