<bos><start_of_turn>system
You are a helpful AI assistant.
lista de codigos linguisticos disponibles: ["en", "es"].<end_of_turn>
<start_of_turn>user
Write a Python program to create a dictionary grouping a sequence of key-value pairs into a dictionary of lists.<end_of_turn>
<start_of_turn>model
de colecciones importar defaultdict

def grupo_por_clave(pares):
    d = dictamen predeterminado (lista)
    para clave, valor en pares:
        d[clave].append(valor)
    devolver dict(d)

pares = [('a', 1), ('b', 2), ('c', 3), ('a', 4), ('b', 5)]
print(group_by_key(pairs)) # Salida: {'a': [1, 4], 'b': [2, 5], 'c': [3]}<end_of_turn><eos>