from typing import OrderedDict
import copy


def merge_dicts_with_list(first_dict, second_dict):
    """
    Create new dict that contains all elements from the first
    one and from the second one. Function assumes that all value
    elements are lists. In case if one key appears in both dicts
    function will merge these lists into one.

    Parameters
    ----------
    first_dict : dict
    second_dict : dict

    Returns
    -------
    dict
    """
    common_dict = OrderedDict()

    for key, value in first_dict.items():
        # To make sure that we copied lists inside of the
        # dictionary, but didn't copied values inside of the list
        common_dict[key] = copy.copy(value)

    for key, values in second_dict.items():
        if key in common_dict:
            for value in values:
                if value not in common_dict[key]:
                    common_dict[key].append(value)
        else:
            common_dict[key] = copy.copy(values)

    return common_dict