the value parameter must be either a single value or a 1-dimensional list.
        All the values in this list must satisfy the condition
765909
def validate_NUMPLACES(in_value, restriction):
    
    #Sometimes restriction values can accidentally be put in the template <item>100</items>,
    #Making them a list, not a number. Rather than blowing up, just get value 1 from the list.
    if type(restriction) is list:
        restriction = restriction[0]

    value = _get_val(in_value)
    if type(value) is list:
        for subval in value:
            if type(subval) is tuple:
                subval = subval[1]
            validate_NUMPLACES(subval, restriction)
    else:
        restriction = int(restriction) # Just in case..
        dec_val = Decimal(str(value))
        num_places = dec_val.as_tuple().exponent * -1 #exponent returns a negative num
        if restriction != num_places:
            raise ValidationError("NUMPLACES: %s"%(restriction))
994438
def p_list_type(self, p):
        ''''''
        p[0] = ast.ListType(value_type=p[3], annotations=p[5])
567220
def set_parameters(self, parameter, value):
        
        if parameter == 'lo':
            self.parameters['lo'] = 1 / value
        else:
            self.parameters[parameter] = value
220882
def to_single_data(input):
    
    if (isinstance(input, (list, tuple)) and len(input) == 1):
        return input[0]
    else:
        assert isinstance(input, dict), input
        return input
940532
def multi_eq(*values)
    # If there is only 1 arg, it must be an array of at least 2 elements.
    values = values.first if values.first.is_a?(Array) && values.size == 1
    raise ArgumentError.new("Must be called with at least 2 parameters; was: #{values.inspect}") if values.size < 2
    values[1..-1].all? { |value| value == values.first }
  end
21759
def equals(self, data):
        

        if isinstance(data, six.string_types):
            return self._add_condition('=', data, types=[int, str])
        elif isinstance(data, list):
            return self._add_condition('IN', ",".join(map(str, data)), types=[str])

        raise QueryTypeError('Expected value of type `str` or `list`, not %s' % type(data))
988324
@Override
    public void validate(String name, String value) throws ParameterException {
        if(!value.equals(ArbiterCliGenerator.REGRESSION) || value.equals(ArbiterCliGenerator.CLASSIFICIATION)) {
            throw new ParameterException("Problem type can only be " + ArbiterCliGenerator.REGRESSION + " or " + ArbiterCliGenerator.CLASSIFICIATION);

        }
    }
83817
private <E> List<E> cons(E value, List<E> list) {
        List<E> result = new ArrayList<E>(list.size() + 1);
        result.add(value);
        result.addAll(list);
        return result;
    }
705637
public String serializeConditionList(List<Condition> list) {
        ObjectMapper om = getObjectMapper();
        try {
            return om.writeValueAsString(new ListWrappers.ConditionList(list));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
758071
def validate_SUMTO(in_value, restriction):
    
    #Sometimes restriction values can accidentally be put in the template <item>100</items>,
    #Making them a list, not a number. Rather than blowing up, just get value 1 from the list.
    if type(restriction) is list:
        restriction = restriction[0]

    value = _get_val(in_value, full=True)

    if len(value) == 0:
        return

    flat_list = _flatten_value(value)

    try:
        sum(flat_list)
    except:
        raise ValidationError("List cannot be summed: %s"%(flat_list,))

    if sum(flat_list) != restriction:
        raise ValidationError("SUMTO: %s"%(restriction))
875434
def []=(index,value)
      if self.shape.count != 1 or index >= self.shape[0]
        raise IndexError.new("You can only set values for array values")
      else
        @array_image[get_index_value(index)] = value
      end
    end
117650
def __wrap_accepted_val(self, value):
        
        if isinstance(value, tuple):
            value = list(value)
        elif not isinstance(value, list):
            value = [value]
        return value
767269
def any(self, axis=0, *args, **kwargs):
        
        nv.validate_any(args, kwargs)

        values = self.sp_values

        if len(values) != len(self) and np.any(self.fill_value):
            return True

        return values.any().item()
133747
def create_single(cls, value, idx='default'):
        

        return LabelList(idx=idx, labels=[
            Label(value=value)
        ])
95096
private void checkAmbiguousValues(Option o, Map<String, String> data) throws RequiredParametersException{
		if (data.containsKey(o.getAlt()) && !Objects.equals(data.get(o.getAlt()), ParameterTool.NO_VALUE_KEY)) {
			throw new RequiredParametersException("Value passed for parameter " + o.getName() +
					" is ambiguous. Value passed for short and long name.");
		}
	}
656246
def _set_value(self, entity, value):
    
    if entity._projection:
      raise ReadonlyPropertyError(
          'You cannot set property values of a projection entity')
    if self._repeated:
      if not isinstance(value, (list, tuple, set, frozenset)):
        raise datastore_errors.BadValueError('Expected list or tuple, got %r' %
                                             (value,))
      value = [self._do_validate(v) for v in value]
    else:
      if value is not None:
        value = self._do_validate(value)
    self._store_value(entity, value)
810564
def parameters(self, value):
        """"""
        self.W = value[0] if isinstance(value[0], GPUArray) else \
          gpuarray.to_gpu(value[0])
        self.b = value[1] if isinstance(value[0], GPUArray) else \
          gpuarray.to_gpu(value[1])