Load a value as a list, converting items if necessary
182335
def to_native(self, value):
        """"""
        if isinstance(value, six.string_types):
            value_list = value.split(self.string_delim)
        else:
            value_list = value

        to_native = self.member_type.to_native if self.member_type is not None else lambda x: x
        return [to_native(item) for item in value_list]
1270626
def decode(cls, value):
        
        try:
            return None if value is None else \
                list(json.loads(value.decode(cls._encoding)))
        except (TypeError, AttributeError):
            return list(value)
17285
private Object asList(Object value) {
        Class<?> componentClass = value.getClass().getComponentType();
        if (componentClass.isPrimitive()) {
            if (componentClass.equals(int.class)) {
                return asIntList(value);
            } else if (componentClass.equals(long.class)) {
                return asLongList(value);
            } else if (componentClass.equals(boolean.class)) {
                return asBooleanList(value);
            } else if (componentClass.equals(short.class)) {
                return asShortList(value);
            } else if (componentClass.equals(byte.class)) {
                return asByteList(value);
            } else {
                return asCharList(value);
            }
        } else {
            return asList(value, componentClass);
        }
    }
460844
def _decode(self, value):
        
        if isinstance(value, list):
            return [self._decode(v) for v in value]
        elif isinstance(value, dict):
            return {self._decode(k): self._decode(v)
                    for k, v in value.items()}
        elif isinstance(value, bytes):
            return value.decode('utf-8')
        return value
1240818
def load(obj):
    
    values = ValueTree()
    def _load(_obj, container):
        for name,value in _obj.items():
            if isinstance(value, dict):
                path = make_path(name)
                container.put_container(path)
                _load(value, container.get_container(path))
            elif isinstance(value, list):
                for item in value:
                    container.append_field(ROOT_PATH, name, item)
            elif isinstance(value, str):
                container.put_field(ROOT_PATH, name, value)
            else:
                raise ValueError()
    _load(obj, values)
    return values
991002
def _wrap(self, value):
        
        if isinstance(value, dict):
            if any(isinstance(name, int) for name in value.keys()):
                if not all(isinstance(name, int) for name in value.keys()):
                    raise RuntimeError("Integer and non-integer keys: %r"
                                       % value.keys())
                items = sorted(value.iteritems(), key=itemgetter(0))
                return [self._wrap(val) for _, val in items]
            else:
                return Arguments(value)
        elif isinstance(value, list):
            return [self._wrap(x) for x in value]
        else:
            return value
180868
def loads(self, value, context=None):
		
		
		if value == '' or (hasattr(value, 'strip') and value.strip() == ''):
			return None
		
		return self.native(value)
45605
def _encode_list(name, value, check_keys, opts):
    """"""
    lname = gen_list_name()
    data = b"".join([_name_value_to_bson(next(lname), item,
                                         check_keys, opts)
                     for item in value])
    return b"\x04" + name + _PACK_INT(len(data) + 5) + data + b"\x00"
396866
def from_list(cls, values):
        """"""
        self = cls()
        for value in values:
            self.add(value)
        return self
358179
def _AsList(arg):
    """"""
    if (isinstance(arg, string_types) or
        not isinstance(arg, collections.Iterable)):
      return [arg]
    else:
      return list(arg)
142305
def convert(obj, ids, attr_type, item_func, cdata, parent='root'):
    """"""
    
    LOG.info('Inside convert(). obj type is: "%s", obj="%s"' % (type(obj).__name__, unicode_me(obj)))
    
    item_name = item_func(parent)
    
    if isinstance(obj, numbers.Number) or type(obj) in (str, unicode):
        return convert_kv(item_name, obj, attr_type, cdata)
        
    if hasattr(obj, 'isoformat'):
        return convert_kv(item_name, obj.isoformat(), attr_type, cdata)
        
    if type(obj) == bool:
        return convert_bool(item_name, obj, attr_type, cdata)
        
    if obj is None:
        return convert_none(item_name, '', attr_type, cdata)
        
    if isinstance(obj, dict):
        return convert_dict(obj, ids, parent, attr_type, item_func, cdata)
        
    if isinstance(obj, collections.Iterable):
        return convert_list(obj, ids, parent, attr_type, item_func, cdata)
        
    raise TypeError('Unsupported data type: %s (%s)' % (obj, type(obj).__name__))
630689
def mset_list(item, index, value):
    ''
    if isinstance(index, (int, slice)):
        item[index] = value
    else:
        map(item.__setitem__, index, value)
281118
def toListFloat(value):
        
        if TypeConverters._can_convert_to_list(value):
            value = TypeConverters.toList(value)
            if all(map(lambda v: TypeConverters._is_numeric(v), value)):
                return [float(v) for v in value]
        raise TypeError("Could not convert %s to list of floats" % value)
425978
private List<Byte> asByteList(Object value) {
        byte[] values = (byte[]) value;
        List<Byte> list = new ArrayList<Byte>(values.length);
        for (byte byteValue : values) {
            list.add(byteValue);
        }
        return list;
    }
33143
def toListString(value):
        
        if TypeConverters._can_convert_to_list(value):
            value = TypeConverters.toList(value)
            if all(map(lambda v: TypeConverters._can_convert_to_string(v), value)):
                return [TypeConverters.toString(v) for v in value]
        raise TypeError("Could not convert %s to list of strings" % value)
1308216
def _to_list(var):
    
    if isinstance(var, list):
        return var
    elif var is None:
        return []
    elif isinstance(var, str) or isinstance(var, dict):
        # We dont want to make a list out of those via the default constructor
        return [var]
    else:
        try:
            return list(var)
        except TypeError:
            return [var]
1199235
def decode(cls, value):
        
        try:
            data = [v for v in value.decode(cls._encoding).split(',') if
                    v != '']
            return data if data else None
        except AttributeError:
            return value