def site_swi_dicts(siteid_list_a, siteid_list_b, site_swi_all_dict):
    """
    Two list of sites, return site-swi dict for each with site-swi only matching those lists.
    :param siteid_list_a: List A of site ids.
    :param siteid_list_b: List B of site ids
    :param site_swi_all_dict: Dict of siteid -> SWI mapping that contains ALL sites in siteid_list_a and
                              siteid_list_b, in format { '<siteid>': ['<SWI1>', '<SWI2>', ...] }
    :return: site-swi dict for list a, site-swi dict for list b
    """

    a_dict = {}
    b_dict = {}

    for siteid in siteid_list_a:
        entry = site_swi_all_dict.get(siteid, None)
        if entry:
            a_dict[siteid] = entry

    for siteid in siteid_list_b:
        entry = site_swi_all_dict.get(siteid, None)
        if entry:
            b_dict[siteid] = entry

    return a_dict, b_dict