def merge_dicts(dicts_a, dicts_b):
    """Merges two lists of dictionaries by key attribute.

    Example:
        da = [{'key': 'a', 'value': 1}, {'key': 'b', 'value': 2}]
        db = [{'key': 'b', 'value': 3, 'color':'pink'}, {'key': 'c', 'value': 4}]
        merge_dicts(da, db) = [{'key': 'a', 'value': 1}, {'key': 'b', 'value': 3, 'color':'pink'}]
    Args:
        dicts_a (list of objs): First dictionary.
        dicts_b (list of objs): Second dictionary.

    Returns:
        list of objs: List of merged dicts.
    """
    for dict_a in dicts_a:
        for dict_b in dicts_b:
            if dict_a['key'] == dict_b['key']:
                for k, v in dict_b.items():
                    dict_a[k] = v
    return dicts_a
