def merge_list(list1, list2, remove_duplicate=False):
    """
    merge two lists
    when remove_duplicate is false, duplicate item will be kept.
    when remove_dupliate is true, no duplicate item is allowed
    """
    merged_list = []
    if not list1 and list2:
        merged_list.extend(list2)
    elif list1 and not list2:
        merged_list.extend(list1)
    elif list1 and list2:
        for item in list1:
            merged_list.append(item)
        for item in list2:
            if (not remove_duplicate or item not in list1):
                merged_list.append(item)

    return merged_list