<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def alloc_vpcid(nexus_ips):
 """Allocate a vpc id for the given list of switch_ips."""


    LOG.debug("alloc_vpc() called")

    vpc_id = 0
    intersect = _get_free_vpcids_on_switches(nexus_ips)
    for intersect_tuple in intersect:
        try:
            update_vpc_entry(nexus_ips, intersect_tuple.vpc_id,
                             False, True)
            vpc_id = intersect_tuple.vpc_id
            break
        except Exception:
            LOG.exception(
                "This exception is expected if another controller "
                "beat us to vpcid %(vpcid)s for nexus %(ip)s",
                {'vpcid': intersect_tuple.vpc_id,
                 'ip': ', '.join(map(str, nexus_ips))})

    return vpc_id