Selects the samples having the metadata attribute between the values provided
        as input

        :param values: a list of elements
        :return a new complex condition
501961
def isin(self, values):
        
        if not isinstance(values, list):
            raise TypeError("Input should be a string. {} was provided".format(type(values)))
        if not (self.name.startswith("(") and self.name.endswith(")")):
            first = True
            new_condition = None
            for v in values:
                if first:
                    first = False
                    new_condition = self.__eq__(v)
                else:
                    new_condition = new_condition.__or__(self.__eq__(v))
            return new_condition
        else:
            raise SyntaxError("You cannot use 'isin' with a complex condition")
150050
private Either<FEELEvent, Object> actualInputsMatchInputValues(EvaluationContext ctx, Object[] params) {
        // check that all the parameters match the input list values if they are defined
        for( int i = 0; i < params.length; i++ ) {
            final DTInputClause input = inputs.get( i );
            // if a list of values is defined, check the the parameter matches the value
            if ( input.getInputValues() != null && ! input.getInputValues().isEmpty() ) {
                final Object parameter = params[i];
                boolean satisfies = input.getInputValues().stream().map( ut -> ut.apply( ctx, parameter ) ).filter( Boolean::booleanValue ).findAny().orElse( false );

                if ( !satisfies ) {
                    String values = input.getInputValuesText();
                    return Either.ofLeft(new InvalidInputEvent( FEELEvent.Severity.ERROR,
                                                  input.getInputExpression()+"='" + parameter + "' does not match any of the valid values " + values + " for decision table '" + getName() + "'.",
                                                  getName(),
                                                  null,
                                                  values )
                            );
                }
            }
        }
        return Either.ofRight(true);
    }
474636
def select_by_value(self, value):
        
        self._selected_key = None
        self._selected_item = None
        for k in self.children:
            item = self.children[k]
            if item.get_text() == value:
                item.attributes['selected'] = 'selected'
                self._selected_key = k
                self._selected_item = item
            else:
                if 'selected' in item.attributes:
                    del item.attributes['selected']
1055228
def setValues(self, values):
        
        ncols = self.getNumCols()
        nindices = self.getNumIndices()
        for key, value in values.items():
            key = Utils.convToList(key)
            assert len(key) == nindices
            value = Utils.convToList(value)
            assert len(value) == ncols-nindices
            self.addRow(key + value)
797337
def set(self, value, samples=0):
        '''
        
        '''
        if self.params.length > self.pos and samples > 0:
            l = min(samples, self.params.length-self.pos)
            self.data[self.pos:self.pos+l] = np.full(l, value, dtype=np.float)
            self.pos += l
        self.latest = value
        return self
610344
def rm_values_fields(x):
    
    if isinstance(x, dict):
        if "values" in x:
            del x["values"]
        else:
            for k, v in x.items():
                if isinstance(v, dict):
                    rm_values_fields(v)
                elif isinstance(v, list):
                    rm_values_fields(v)
    elif isinstance(x, list):
        for i in x:
            rm_values_fields(i)

    return x
808289
def _filter_by_simple_schema(self, qs, lookup, sublookup, value, schema):
        
        value_lookup = 'attrs__value_%s' % schema.datatype
        if sublookup:
            value_lookup = '%s__%s' % (value_lookup, sublookup)
        return {
            'attrs__schema': schema,
            str(value_lookup): value
        }
168987
def set(self, values):
        
        if hasattr(self, "inputs"):
            for item in self.inputs:
                if hasattr(self, item):
                    setattr(self, item, values[item])
1304469
def selected(self, ids):
        
        # Cleanup the ID list
        if self.get_field_name() == 'pk':
            ids = filter(lambda x: "{}".format(x).isdigit(), copy(ids))
        else:
            ids = filter(lambda x: len("{}".format(x)) > 0, copy(ids))
        # Prepare the QS
        # TODO: not contextually filtered, check if it's possible at some point
        qs = self.get_model_queryset().filter(
            **{'{}__in'.format(self.get_field_name()): ids})
        result = []
        for item in qs:
            item_repr = self.item(item)
            result.append(
                (item_repr['value'], item_repr['label'])
            )
        return result
1029712
def filter_params(self, value):
        
        if value is None:
            return {}

        val_min = value.get('min', None)
        val_max = value.get('max', None)
        params = {}

        if val_min == val_max:
            return { self.target: val_min }

        key = self.target + "__"
        if val_min is not None:
            params[key+self.lookup_types[0]] = val_min
        if val_max is not None:
            params[key+self.lookup_types[1]] = val_max

        return params
1006089
def filter_set(input, **params):
    
    PARAM_WHERE = 'where'

    return Converter.df2list(pd.DataFrame.from_records(input).query(params.get(PARAM_WHERE)))
761347
def _iter_over_selections(obj, dim, values):
    """"""
    from .groupby import _dummy_copy

    dummy = None
    for value in values:
        try:
            obj_sel = obj.sel(**{dim: value})
        except (KeyError, IndexError):
            if dummy is None:
                dummy = _dummy_copy(obj)
            obj_sel = dummy
        yield obj_sel
912922
def In(self, *values):
    
    self._awql = self._CreateMultipleValuesCondition(values, 'IN')
    return self._query_builder
861002
def select_values values
      return unless values
      values.each do |val|
        row = @list.index val
        add_row_selection_interval row, row unless row.nil?
      end
    end
531088
def select(self, model):
    
    res = []

    def doSelect(value, pre, remaining):
      if not remaining:
        res.append((pre, value))
      else:
        # For the other selectors to work, value must be a Tuple or a list at this point.
        if not is_tuple(value) and not isinstance(value, list):
          return

        qhead, qtail = remaining[0], remaining[1:]
        if isinstance(qhead, tuple) and is_tuple(value):
          for alt in qhead:
            if alt in value:
              doSelect(value[alt], pre + [alt], qtail)
        elif qhead == '*':
          if isinstance(value, list):
            indices = range(len(value))
            reprs = [listKey(i) for i in indices]
          else:
            indices = value.keys()
            reprs = indices

          for key, rep in zip(indices, reprs):
            doSelect(value[key], pre + [rep], qtail)
        elif isinstance(qhead, int) and isinstance(value, list):
          doSelect(value[qhead], pre + [listKey(qhead)], qtail)
        elif is_tuple(value):
          if qhead in value:
            doSelect(value[qhead], pre + [qhead], qtail)

    for selector in self.selectors:
      doSelect(model, [], selector)

    return QueryResult(res)
1219344
def filter_by_value(cls, value):
        
        constants = []
        for constant in cls.iterconstants():
            if constant.value == value:
                constants.append(constant)
        return constants
1262279
public static <T> T pick(List<T> values) {
		if (values == null || values.size() == 0)
			return null;

		int index = RandomInteger.nextInteger(values.size());
		return values.get(index);
	}