def _lookup_vpc_allocs(query_type, session=None, order=None, **bfilter):
if session is None:<EOL><INDENT>session = bc.get_reader_session()<EOL><DEDENT>if order:<EOL><INDENT>query_method = getattr(session.query(<EOL>nexus_models_v2.NexusVPCAlloc).filter_by(**bfilter).order_by(<EOL>order),<EOL>query_type)<EOL><DEDENT>else:<EOL><INDENT>query_method = getattr(session.query(<EOL>nexus_models_v2.NexusVPCAlloc).filter_by(**bfilter), query_type)<EOL><DEDENT>try:<EOL><INDENT>vpcs = query_method()<EOL>if vpcs:<EOL><INDENT>return vpcs<EOL><DEDENT><DEDENT>except sa_exc.NoResultFound:<EOL><INDENT>pass<EOL><DEDENT>raise c_exc.NexusVPCAllocNotFound(**bfilter)<EOL>
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.