Keyword.pop_values

You're seeing just the function pop_values, go back to Keyword module for more information.
Link to this function

pop_values(keywords, key)

View Source (since 1.10.0)

Specs

pop_values(t(), key()) :: {[value()], t()}

Returns all values for key and removes all associated entries in the keyword list.

It returns a tuple where the first element is a list of values for key and the second element is a keyword list with all entries associated with key removed. If the key is not present in the keyword list, {[], keyword_list} is returned.

If you don't want to remove all the entries associated with key use pop_first/3 instead, that function will remove only the first entry.

Examples

iex> Keyword.pop_values([a: 1], :a)
{[1], []}
iex> Keyword.pop_values([a: 1], :b)
{[], [a: 1]}
iex> Keyword.pop_values([a: 1, a: 2], :a)
{[1, 2], []}