<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _get_free_vpcids_on_switches(switch_ip_list):
    '''Get intersect list of free vpcids in list of switches.'''

    session = bc.get_reader_session()

    prev_view = aliased(nexus_models_v2.NexusVPCAlloc)
    query = session.query(prev_view.vpc_id)
    prev_swip = switch_ip_list[0]

    for ip in switch_ip_list[1:]:
        cur_view = aliased(nexus_models_v2.NexusVPCAlloc)
        cur_swip = ip
        query = query.join(cur_view, sa.and_(
            prev_view.switch_ip == prev_swip, prev_view.active == False,  # noqa
            cur_view.switch_ip == cur_swip, cur_view.active == False,     # noqa
            prev_view.vpc_id == cur_view.vpc_id))
        prev_view = cur_view
        prev_swip = cur_swip

    unique_vpcids = query.all()
    shuffle(unique_vpcids)
    return unique_vpcids