def merge_dicts(a, b):
    """combine two dictionaries, assuming components are arrays"""

    result = a
    for k, v in b.items():
        if k not in result:
            result[k] = []
        result[k].extend(v)
    return result