<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _lookup_vpc_allocs(query_type, session=None, order=None, **bfilter):
 """Look up 'query_type' Nexus VPC Allocs matching the filter. :param query_type: 'all', 'one' or 'first' :param session: db session :param order: select what field to order data :param bfilter: filter for mappings query :returns: VPCs if query gave a result, else raise NexusVPCAllocNotFound. """


    if session is None:
        session = bc.get_reader_session()

    if order:
        query_method = getattr(session.query(
            nexus_models_v2.NexusVPCAlloc).filter_by(**bfilter).order_by(
                order),
            query_type)
    else:
        query_method = getattr(session.query(
            nexus_models_v2.NexusVPCAlloc).filter_by(**bfilter), query_type)

    try:
        vpcs = query_method()
        if vpcs:
            return vpcs
    except sa_exc.NoResultFound:
        pass

    raise c_exc.NexusVPCAllocNotFound(**bfilter)