def _process_create_allowed_address_pairs(self, context, port,
                                              allowed_address_pairs):
        if not validators.is_attr_set(allowed_address_pairs):
            return []
        try:
            with context.session.begin(subtransactions=True):
                for address_pair in allowed_address_pairs:
                    # use port.mac_address if no mac address in address pair
                    if 'mac_address' not in address_pair:
                        address_pair['mac_address'] = port['mac_address']
                    db_pair = AllowedAddressPair(
                        port_id=port['id'],
                        mac_address=address_pair['mac_address'],
                        ip_address=address_pair['ip_address'])
                    context.session.add(db_pair)
        except db_exc.DBDuplicateEntry:
            raise addr_pair.DuplicateAddressPairInRequest(
                mac_address=address_pair['mac_address'],
                ip_address=address_pair['ip_address'])

        return allowed_address_pairs
dataset/ETHPy150Open openstack/neutron/neutron/db/allowedaddresspairs_db.py/AllowedAddressPairsMixin._process_create_allowed_address_pairs/original