Converts the value into a list.
332398
def to_python(self, value):
        
        if not value:
            value = []

        # If a list is set then validated its items
        if isinstance(value, list):
            py_list = self.validate_list(value)
        else:  # try to de-serialize value and expect list and then validate
            try:
                py_list = json.loads(value)

                if not isinstance(py_list, list):
                    raise TypeError

                self.validate_list(py_list)
            except (ValueError, TypeError):
                raise ValidationError(u'Must be a valid list of strings.')

        return py_list
385108
def as_tuple(self, value):
        """"""
        if isinstance(value, list):
            value = tuple(value)
        return value
1203197
def parse_list(cls, data):
        """"""
        results = ResultSet()
        data = data or []
        for obj in data:
            if obj:
                results.append(cls.parse(obj))
        return results
471034
def values(self):
        """"""
        values = []
        for __, data in self.items():
            values.append(data)
        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
93390
private void addToList(List<Object> list, Object value) {
    if (value instanceof List) {
      list.addAll((List) value);
    } else {
      list.add(value);
    }
  }
542388
private static List<JsonObject> getJsonValueAsList(JsonValue value) {
        if (value != null) {
            if (value.getValueType() == ValueType.ARRAY) {
                return value.asJsonArray().getValuesAs(JsonObject.class);

            } else if (value.getValueType() == ValueType.OBJECT) {
                List<JsonObject> ret = new ArrayList<>();
                ret.add(value.asJsonObject());

                return ret;
            }
        }
        return null;
    }
526126
def split_elements(value):
    """"""
    l = [v.strip() for v in value.split(',')]
    if len(l) == 1:
        l = value.split()
    return l
908018
def toListInt(value):
        
        if TypeConverters._can_convert_to_list(value):
            value = TypeConverters.toList(value)
            if all(map(lambda v: TypeConverters._is_integer(v), value)):
                return [int(v) for v in value]
        raise TypeError("Could not convert %s to list of ints" % value)
233996
def format_value(value):
    
    if isinstance(value, list):
        value = ", ".join([v.strip() for v in value])
    return value
171078
def lists(self, value, key=None):
        
        results = map(lambda x: x[value], self._items)

        return list(results)
1063611
def to_python(self, value):
        """"""
        if not value:
            return []
        return map(super(CommaSepFloatField, self).to_python, value.split(','))
85210
def _as_list(obj):
    """"""
    if obj is None:
        return None
    elif isinstance(obj, string_types):
        return [obj]
    elif isinstance(obj, tuple):
        return list(obj)
    elif not hasattr(obj, '__len__'):
        return [obj]
    else:
        return obj
787940
public static List<String> splitToList(final String value) {
        if (!StringUtils.isEmpty(value)) {
            return COMMA_SPLITTER.splitToList(value);
        }
        return Collections.<String> emptyList();
    }
1320335
def __construct_list(self, list_value):
        
        array = []
        for value in list_value:
            array.append(self.__iterate_value(value))
        return array
396866
def from_list(cls, values):
        """"""
        self = cls()
        for value in values:
            self.add(value)
        return self
1061906
def index(self, value):
        

        for i, x in enumerate(self):
            if x == value:
                return i

        raise ValueError("{} is not in list".format(value))