Puts a value into a map that supports lists as values.
The list is created on-demand.
165453
public static <K, V> void putAllIntoListMap(K key, Collection<? extends V> values, Map<? super K, List<V>> map) {
		List<V> list = map.get(key);
		if (list == null) {
			list = Lists.newArrayList(values);
			map.put(key, list);
		} else {
			list.addAll(values);
		}
	}
803355
public MapBuilder<K,V> put( K key, V value)
    {
    map_.put( key, value);
    return this;
    }
444578
public static <T> void putAt(List<T> self, int idx, T value) {
        int size = self.size();
        idx = normaliseIndex(idx, size);
        if (idx < size) {
            self.set(idx, value);
        } else {
            while (size < idx) {
                self.add(size++, null);
            }
            self.add(idx, value);
        }
    }
635680
def save_list(key, *values):
    
    return json.dumps({key: [_get_json(value) for value in values]})
524555
public static <K, V> void putIntoSetMap(K key, V value, Map<? super K, Set<V>> map) {
		Set<V> list = map.get(key);
		if (list == null) {
			list = Sets.newHashSetWithExpectedSize(2);
			map.put(key, list);
		}
		list.add(value);
	}
683985
def serialize_list(self, value):
        

        # Check if this is a list or a tuple
        if not isinstance(value, (list, tuple)):
            return value

        # Loop over all the values and serialize the values
        return [
            self.serialize_value(list_value)
            for list_value in value
        ]
1006607
public final void put(String key, int value)
  {

    if ((m_firstFree + 1) >= m_mapSize)
    {
      m_mapSize += m_blocksize;

      String newMap[] = new String[m_mapSize];

      System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1);

      m_map = newMap;

      int newValues[] = new int[m_mapSize];

      System.arraycopy(m_values, 0, newValues, 0, m_firstFree + 1);

      m_values = newValues;
    }

    m_map[m_firstFree] = key;
    m_values[m_firstFree] = value;

    m_firstFree++;
  }
879800
public ValueMap putValue(String key, Object value) {
    delegate.put(key, value);
    return this;
  }
443121
def add(self, value):
        """"""
        if value not in self._set:
            self._set.add(value)
            self._list.add(value)
121889
public static VariableMap putValue(String name, Object value) {
    return createVariables().putValue(name, value);
  }
1007108
def set(cls, obj, keys, value, fill_list_value=None):
        
        current = obj
        keys_list = keys.split(".")

        for idx, key in enumerate(keys_list, 1):
            if type(current) == list:
                # Validate this key works with a list.
                try:
                    key = int(key)
                except ValueError:
                    raise cls.Missing(key)

            try:
                # This is the last key, so set the value.
                if idx == len(keys_list):
                    if type(current) == list:
                        safe_list_set(
                            current,
                            key,
                            lambda: copy.copy(fill_list_value),
                            value
                        )
                    else:
                        current[key] = value

                    # done.
                    return

                # More keys left, ensure we have a container for this key.
                if type(key) == int:
                    try:
                        current[key]
                    except IndexError:
                        # Create a list for this key.
                        cnext = container_for_key(keys_list[idx])
                        if type(cnext) == list:
                            def fill_with():
                                return []
                        else:
                            def fill_with():
                                return {}

                        safe_list_set(
                            current,
                            key,
                            fill_with,
                            [] if type(cnext) == list else {}
                        )
                else:
                    if key not in current:
                        # Create a list for this key.
                        current[key] = container_for_key(keys_list[idx])

                # Move on to the next key.
                current = current[key]
            except (IndexError, KeyError, TypeError):
                raise cls.Missing(key)
1356233
def extendlist(lst, i, value=''):
    """"""
    if i < len(lst):
        pass
    else:
        lst.extend([value, ] * (i - len(lst) + 1))
121800
public void add(String key, String value)
    {
        if(key == null)
            throw new IllegalArgumentException("Null keys not allowed.");

        if(value == null)
            throw new IllegalArgumentException("Null values not allowed.");

        List<String> vals = map.get(key);
        if(vals == null)
        {
            vals = new ArrayList<String>();
            map.put(key,vals);
        }

        vals.add(value);
    }
141263
public static void addToListIfNotExists(List<String> list, String value) {
        boolean found = false;
        for (String item : list) {
            if (item.equalsIgnoreCase(value)) {
                found = true;
                break;
            }
        }
        if (!found) {
            list.add(value);
        }
    }
307983
public static JCalValue object(ListMultimap<String, Object> value) {
		Map<String, JsonValue> object = new LinkedHashMap<String, JsonValue>();
		for (Map.Entry<String, List<Object>> entry : value) {
			String key = entry.getKey();
			List<Object> list = entry.getValue();

			JsonValue v;
			if (list.size() == 1) {
				v = new JsonValue(list.get(0));
			} else {
				List<JsonValue> array = new ArrayList<JsonValue>(list.size());
				for (Object element : list) {
					array.add(new JsonValue(element));
				}
				v = new JsonValue(array);
			}
			object.put(key, v);
		}
		return new JCalValue(new JsonValue(object));
	}
541809
def options(self, value):
        
        if value is None:
            value = []
        assert isinstance(value, list)
        self._options = value
222145
private static <K, V> void set(Map<K, Set<V>> map, K key, V value) {
    Set<V> values = map.get(key);
    if (values == null) {
      values = new HashSet<>();
      map.put(key, values);
    }
    values.add(value);
  }